org.eclipse.ui.views.contentoutline.ContentOutlinePage Java Examples

The following examples show how to use org.eclipse.ui.views.contentoutline.ContentOutlinePage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiPageReportEditor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public boolean reloadOutlinePage( )
{
	if ( !getActivePageInstance( ).getId( ).equals( XMLSourcePage_ID )
			|| outlinePage == null
			|| !getCurrentPageInstance( ).getId( )
					.equals( XMLSourcePage_ID ) )
	{
		return false;
	}

	if ( outlinePage.getCurrentPage( ) instanceof DesignerOutlinePage
			|| outlinePage.getCurrentPage( ) == null
			|| outlinePage.getCurrentPage( ) instanceof EmptyPage )
	{
		outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( IContentOutlinePage.class ) );
	}
	else
	{
		outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( ContentOutlinePage.class ) );
	}
	if ( outlinePage.getSite( ) != null )
	{
		outlinePage.getSite( ).getActionBars( ).updateActionBars( );
	}
	return true;
}
 
Example #2
Source File: MultiPageReportEditor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void outlineSwitch( )
{
	if ( !getActivePageInstance( ).getId( ).equals( XMLSourcePage_ID )
			|| outlinePage == null )
	{
		return;
	}

	if ( outlinePage.getCurrentPage( ) instanceof DesignerOutlinePage )
	{
		outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( ContentOutlinePage.class ) );
	}
	else
	{
		outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( IContentOutlinePage.class ) );
	}
	outlinePage.getSite( ).getActionBars( ).updateActionBars( );
}
 
Example #3
Source File: SecurityEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
                ( new ISelectionChangedListener ()
                {
                    // This ensures that we handle selections correctly.
                    //
                    public void selectionChanged ( SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return contentOutlinePage;
}
 
Example #4
Source File: ExtensionsEditor.java    From ifml-editor with MIT License 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
	if (contentOutlinePage == null) {
		// The content outline is just a tree.
		//
		class MyContentOutlinePage extends ContentOutlinePage {
			@Override
			public void createControl(Composite parent) {
				super.createControl(parent);
				contentOutlineViewer = getTreeViewer();
				contentOutlineViewer.addSelectionChangedListener(this);

				// Set up the tree viewer.
				//
				contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
				contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
				contentOutlineViewer.setInput(editingDomain.getResourceSet());

				// Make sure our popups work.
				//
				createContextMenuFor(contentOutlineViewer);

				if (!editingDomain.getResourceSet().getResources().isEmpty()) {
				  // Select the root object in the view.
				  //
				  contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
				}
			}

			@Override
			public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
				super.makeContributions(menuManager, toolBarManager, statusLineManager);
				contentOutlineStatusLineManager = statusLineManager;
			}

			@Override
			public void setActionBars(IActionBars actionBars) {
				super.setActionBars(actionBars);
				getActionBarContributor().shareGlobalActions(this, actionBars);
			}
		}

		contentOutlinePage = new MyContentOutlinePage();

		// Listen to selection so that we can handle it is a special way.
		//
		contentOutlinePage.addSelectionChangedListener
			(new ISelectionChangedListener() {
				 // This ensures that we handle selections correctly.
				 //
				 public void selectionChanged(SelectionChangedEvent event) {
					 handleContentOutlineSelection(event.getSelection());
				 }
			 });
	}

	return contentOutlinePage;
}
 
Example #5
Source File: CoreEditor.java    From ifml-editor with MIT License 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
	if (contentOutlinePage == null) {
		// The content outline is just a tree.
		//
		class MyContentOutlinePage extends ContentOutlinePage {
			@Override
			public void createControl(Composite parent) {
				super.createControl(parent);
				contentOutlineViewer = getTreeViewer();
				contentOutlineViewer.addSelectionChangedListener(this);

				// Set up the tree viewer.
				//
				contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
				contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
				contentOutlineViewer.setInput(editingDomain.getResourceSet());

				// Make sure our popups work.
				//
				createContextMenuFor(contentOutlineViewer);

				if (!editingDomain.getResourceSet().getResources().isEmpty()) {
				  // Select the root object in the view.
				  //
				  contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
				}
			}

			@Override
			public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
				super.makeContributions(menuManager, toolBarManager, statusLineManager);
				contentOutlineStatusLineManager = statusLineManager;
			}

			@Override
			public void setActionBars(IActionBars actionBars) {
				super.setActionBars(actionBars);
				getActionBarContributor().shareGlobalActions(this, actionBars);
			}
		}

		contentOutlinePage = new MyContentOutlinePage();

		// Listen to selection so that we can handle it is a special way.
		//
		contentOutlinePage.addSelectionChangedListener
			(new ISelectionChangedListener() {
				 // This ensures that we handle selections correctly.
				 //
				 public void selectionChanged(SelectionChangedEvent event) {
					 handleContentOutlineSelection(event.getSelection());
				 }
			 });
	}

	return contentOutlinePage;
}
 
Example #6
Source File: EipEditor.java    From eip-designer with Apache License 2.0 4 votes vote down vote up
/**
   * This accesses a cached version of the content outliner.
   * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
   * @generated
   */
public IContentOutlinePage getContentOutlinePage() {
     if (contentOutlinePage == null) {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage {
           @Override
           public void createControl(Composite parent) {
              super.createControl(parent);
              contentOutlineViewer = getTreeViewer();
              contentOutlineViewer.addSelectionChangedListener(this);

              // Set up the tree viewer.
              //
              contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
              contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
              contentOutlineViewer.setInput(editingDomain.getResourceSet());

              // Make sure our popups work.
              //
              createContextMenuFor(contentOutlineViewer);

              if (!editingDomain.getResourceSet().getResources().isEmpty()) {
                // Select the root object in the view.
                //
                contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
              }
           }

           @Override
           public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
              super.makeContributions(menuManager, toolBarManager, statusLineManager);
              contentOutlineStatusLineManager = statusLineManager;
           }

           @Override
           public void setActionBars(IActionBars actionBars) {
              super.setActionBars(actionBars);
              getActionBarContributor().shareGlobalActions(this, actionBars);
           }
        }

        contentOutlinePage = new MyContentOutlinePage();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
           (new ISelectionChangedListener() {
               // This ensures that we handle selections correctly.
               //
               public void selectionChanged(SelectionChangedEvent event) {
                  handleContentOutlineSelection(event.getSelection());
               }
            });
     }

     return contentOutlinePage;
  }
 
Example #7
Source File: BeansEditor.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
	if (contentOutlinePage == null) {
		// The content outline is just a tree.
		//
		class MyContentOutlinePage extends ContentOutlinePage {
			@Override
			public void createControl(Composite parent) {
				super.createControl(parent);
				contentOutlineViewer = getTreeViewer();
				contentOutlineViewer.addSelectionChangedListener(this);

				// Set up the tree viewer.
				//
				contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
				contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
				contentOutlineViewer.setInput(editingDomain.getResourceSet());

				// Make sure our popups work.
				//
				createContextMenuFor(contentOutlineViewer);

				if (!editingDomain.getResourceSet().getResources().isEmpty()) {
				  // Select the root object in the view.
				  //
				  contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
				}
			}

			@Override
			public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
				super.makeContributions(menuManager, toolBarManager, statusLineManager);
				contentOutlineStatusLineManager = statusLineManager;
			}

			@Override
			public void setActionBars(IActionBars actionBars) {
				super.setActionBars(actionBars);
				getActionBarContributor().shareGlobalActions(this, actionBars);
			}
		}

		contentOutlinePage = new MyContentOutlinePage();

		// Listen to selection so that we can handle it is a special way.
		//
		contentOutlinePage.addSelectionChangedListener
			(new ISelectionChangedListener() {
				 // This ensures that we handle selections correctly.
				 //
				 public void selectionChanged(SelectionChangedEvent event) {
					 handleContentOutlineSelection(event.getSelection());
				 }
			 });
	}

	return contentOutlinePage;
}
 
Example #8
Source File: GenconfEditor.java    From M2Doc with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
    if (contentOutlinePage == null) {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage {
            @Override
            public void createControl(Composite parent) {
                super.createControl(parent);
                contentOutlineViewer = getTreeViewer();
                contentOutlineViewer.addSelectionChangedListener(this);

                // Set up the tree viewer.
                //
                contentOutlineViewer.setUseHashlookup(true);
                contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
                contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
                contentOutlineViewer.setInput(editingDomain.getResourceSet());

                // Make sure our popups work.
                //
                createContextMenuFor(contentOutlineViewer);

                if (!editingDomain.getResourceSet().getResources().isEmpty()) {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection(
                            new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
                }
            }

            @Override
            public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
                    IStatusLineManager statusLineManager) {
                super.makeContributions(menuManager, toolBarManager, statusLineManager);
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars(IActionBars actionBars) {
                super.setActionBars(actionBars);
                getActionBarContributor().shareGlobalActions(this, actionBars);
            }
        }

        contentOutlinePage = new MyContentOutlinePage();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged(SelectionChangedEvent event) {
                handleContentOutlineSelection(event.getSelection());
            }
        });
    }

    return contentOutlinePage;
}
 
Example #9
Source File: CrossflowEditor.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
	if (contentOutlinePage == null) {
		// The content outline is just a tree.
		//
		class MyContentOutlinePage extends ContentOutlinePage {
			@Override
			public void createControl(Composite parent) {
				super.createControl(parent);
				contentOutlineViewer = getTreeViewer();
				contentOutlineViewer.addSelectionChangedListener(this);

				// Set up the tree viewer.
				//
				contentOutlineViewer.setUseHashlookup(true);
				contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
				contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
				contentOutlineViewer.setInput(editingDomain.getResourceSet());

				// Make sure our popups work.
				//
				createContextMenuFor(contentOutlineViewer);

				if (!editingDomain.getResourceSet().getResources().isEmpty()) {
				  // Select the root object in the view.
				  //
				  contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
				}
			}

			@Override
			public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
				super.makeContributions(menuManager, toolBarManager, statusLineManager);
				contentOutlineStatusLineManager = statusLineManager;
			}

			@Override
			public void setActionBars(IActionBars actionBars) {
				super.setActionBars(actionBars);
				getActionBarContributor().shareGlobalActions(this, actionBars);
			}
		}

		contentOutlinePage = new MyContentOutlinePage();

		// Listen to selection so that we can handle it is a special way.
		//
		contentOutlinePage.addSelectionChangedListener
			(new ISelectionChangedListener() {
				 // This ensures that we handle selections correctly.
				 //
				 public void selectionChanged(SelectionChangedEvent event) {
					 handleContentOutlineSelection(event.getSelection());
				 }
			 });
	}

	return contentOutlinePage;
}
 
Example #10
Source File: ConfigurationEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
                ( new ISelectionChangedListener ()
                {
                    // This ensures that we handle selections correctly.
                    //
                    public void selectionChanged ( SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return contentOutlinePage;
}
 
Example #11
Source File: ItemEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
                ( new ISelectionChangedListener ()
                {
                    // This ensures that we handle selections correctly.
                    //
                    public void selectionChanged ( SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return contentOutlinePage;
}
 
Example #12
Source File: ComponentEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain, contentOutlineViewer, ComponentEditorPlugin.getPlugin ().getDialogSettings () ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #13
Source File: GlobalizeEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #14
Source File: ProtocolEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
                ( new ISelectionChangedListener ()
                {
                    // This ensures that we handle selections correctly.
                    //
                    public void selectionChanged ( SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return contentOutlinePage;
}
 
Example #15
Source File: InfrastructureEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setUseHashlookup ( true );
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain, contentOutlineViewer, InfrastructureEditorPlugin.getPlugin ().getDialogSettings () ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #16
Source File: RecipeEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #17
Source File: MemoryEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #18
Source File: WorldEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #19
Source File: OsgiEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #20
Source File: ProfileEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #21
Source File: SetupEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #22
Source File: DeploymentEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new DelegatingStyledCellLabelProvider ( new DecoratingColumLabelProvider.StyledLabelProvider ( new AdapterFactoryLabelProvider.StyledLabelProvider ( adapterFactory, contentOutlineViewer ), new DiagnosticDecorator.Styled ( editingDomain.getResourceSet (), contentOutlineViewer ) ) ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                new ColumnViewerInformationControlToolTipSupport ( contentOutlineViewer, new DiagnosticDecorator.Styled.EditingDomainLocationListener ( editingDomain, contentOutlineViewer ) );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #23
Source File: VisualInterfaceEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setUseHashlookup ( true );
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener ( new ISelectionChangedListener () {
            // This ensures that we handle selections correctly.
            //
            public void selectionChanged ( SelectionChangedEvent event )
            {
                handleContentOutlineSelection ( event.getSelection () );
            }
        } );
    }

    return contentOutlinePage;
}
 
Example #24
Source File: DetailViewEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( Composite parent )
            {
                super.createControl ( parent );
                contentOutlineViewer = getTreeViewer ();
                contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                contentOutlineViewer.setContentProvider ( new AdapterFactoryContentProvider ( adapterFactory ) );
                contentOutlineViewer.setLabelProvider ( new AdapterFactoryLabelProvider ( adapterFactory ) );
                contentOutlineViewer.setInput ( editingDomain.getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( contentOutlineViewer );

                if ( !editingDomain.getResourceSet ().getResources ().isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    contentOutlineViewer.setSelection ( new StructuredSelection ( editingDomain.getResourceSet ().getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager, statusLineManager );
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this, actionBars );
            }
        }

        contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        contentOutlinePage.addSelectionChangedListener
                ( new ISelectionChangedListener ()
                {
                    // This ensures that we handle selections correctly.
                    //
                    public void selectionChanged ( SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return contentOutlinePage;
}
 
Example #25
Source File: ChartEditor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
public IContentOutlinePage getContentOutlinePage ()
{
    if ( this.contentOutlinePage == null )
    {
        // The content outline is just a tree.
        //
        class MyContentOutlinePage extends ContentOutlinePage
        {
            @Override
            public void createControl ( final Composite parent )
            {
                super.createControl ( parent );
                ChartEditor.this.contentOutlineViewer = getTreeViewer ();
                ChartEditor.this.contentOutlineViewer.addSelectionChangedListener ( this );

                // Set up the tree viewer.
                //
                ChartEditor.this.contentOutlineViewer
                        .setContentProvider ( new AdapterFactoryContentProvider (
                                ChartEditor.this.adapterFactory ) );
                ChartEditor.this.contentOutlineViewer
                        .setLabelProvider ( new AdapterFactoryLabelProvider (
                                ChartEditor.this.adapterFactory ) );
                ChartEditor.this.contentOutlineViewer.setInput ( ChartEditor.this.editingDomain
                        .getResourceSet () );

                // Make sure our popups work.
                //
                createContextMenuFor ( ChartEditor.this.contentOutlineViewer );

                if ( !ChartEditor.this.editingDomain.getResourceSet ().getResources ()
                        .isEmpty () )
                {
                    // Select the root object in the view.
                    //
                    ChartEditor.this.contentOutlineViewer
                            .setSelection ( new StructuredSelection (
                                    ChartEditor.this.editingDomain.getResourceSet ()
                                            .getResources ().get ( 0 ) ), true );
                }
            }

            @Override
            public void makeContributions ( final IMenuManager menuManager,
                    final IToolBarManager toolBarManager,
                    final IStatusLineManager statusLineManager )
            {
                super.makeContributions ( menuManager, toolBarManager,
                        statusLineManager );
                ChartEditor.this.contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars ( final IActionBars actionBars )
            {
                super.setActionBars ( actionBars );
                getActionBarContributor ().shareGlobalActions ( this,
                        actionBars );
            }
        }

        this.contentOutlinePage = new MyContentOutlinePage ();

        // Listen to selection so that we can handle it is a special way.
        //
        this.contentOutlinePage
                .addSelectionChangedListener ( new ISelectionChangedListener () {
                    // This ensures that we handle selections correctly.
                    //
                    @Override
                    public void selectionChanged ( final SelectionChangedEvent event )
                    {
                        handleContentOutlineSelection ( event.getSelection () );
                    }
                } );
    }

    return this.contentOutlinePage;
}