Public Member Functions | Protected Member Functions | Protected Attributes

de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor Class Reference

List of all members.

Public Member Functions

void contributeToMenu (IMenuManager menuManager)
void contributeToToolBar (IToolBarManager toolBarManager)
 DatatypesActionBarContributor ()
void menuAboutToShow (IMenuManager menuManager)
void selectionChanged (SelectionChangedEvent event)
void setActiveEditor (IEditorPart part)

Protected Member Functions

void addGlobalActions (IMenuManager menuManager)
void depopulateManager (IContributionManager manager, Collection<?extends IAction > actions)
Collection< IAction > generateCreateChildActions (Collection<?> descriptors, ISelection selection)
Collection< IAction > generateCreateSiblingActions (Collection<?> descriptors, ISelection selection)
void populateManager (IContributionManager manager, Collection<?extends IAction > actions, String contributionID)
boolean removeAllReferencesOnDelete ()

Protected Attributes

IEditorPart activeEditorPart
Collection< IAction > createChildActions
IMenuManager createChildMenuManager
Collection< IAction > createSiblingActions
IMenuManager createSiblingMenuManager
IAction refreshViewerAction
ISelectionProvider selectionProvider
IAction showPropertiesViewAction

Detailed Description

This is the action bar contributor for the Datatypes model editor.


Constructor & Destructor Documentation

de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.DatatypesActionBarContributor (  ) 

This creates an instance of the contributor.


Member Function Documentation

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.addGlobalActions ( IMenuManager  menuManager  )  [protected]

This inserts global actions before the "additions-end" separator.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.contributeToMenu ( IMenuManager  menuManager  ) 

This adds to the menu bar a menu and some separators for editor additions, as well as the sub-menus for object creation items.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.contributeToToolBar ( IToolBarManager  toolBarManager  ) 

This adds Separators for editor additions to the tool bar.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.depopulateManager ( IContributionManager  manager,
Collection<?extends IAction >  actions 
) [protected]

This removes from the specified manager all org.eclipse.jface.action.ActionContributionItems based on the org.eclipse.jface.action.IActions contained in the actions collection.

Collection<IAction> de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.generateCreateChildActions ( Collection<?>  descriptors,
ISelection  selection 
) [protected]

This generates a org.eclipse.emf.edit.ui.action.CreateChildAction for each object in descriptors, and returns the collection of these actions.

Collection<IAction> de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.generateCreateSiblingActions ( Collection<?>  descriptors,
ISelection  selection 
) [protected]

This generates a org.eclipse.emf.edit.ui.action.CreateSiblingAction for each object in descriptors, and returns the collection of these actions.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.menuAboutToShow ( IMenuManager  menuManager  ) 

This populates the pop-up menu before it appears.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.populateManager ( IContributionManager  manager,
Collection<?extends IAction >  actions,
String  contributionID 
) [protected]

This populates the specified manager with org.eclipse.jface.action.ActionContributionItems based on the org.eclipse.jface.action.IActions contained in the actions collection, by inserting them before the specified contribution item contributionID. If contributionID is null, they are simply added.

boolean de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.removeAllReferencesOnDelete (  )  [protected]

This ensures that a delete action will clean up all references to deleted objects.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.selectionChanged ( SelectionChangedEvent  event  ) 

This implements org.eclipse.jface.viewers.ISelectionChangedListener, handling org.eclipse.jface.viewers.SelectionChangedEvents by querying for the children and siblings that can be added to the selected object and updating the menus accordingly.

void de.fraunhofer.isst.eastadl.datatypes.presentation.DatatypesActionBarContributor.setActiveEditor ( IEditorPart  part  ) 

When the active editor changes, this remembers the change and registers with it as a selection provider.


Member Data Documentation

This keeps track of the active editor.

This will contain one org.eclipse.emf.edit.ui.action.CreateChildAction corresponding to each descriptor generated for the current selection by the item provider.

This is the menu manager into which menu contribution items should be added for CreateChild actions.

This will contain one org.eclipse.emf.edit.ui.action.CreateSiblingAction corresponding to each descriptor generated for the current selection by the item provider.

This is the menu manager into which menu contribution items should be added for CreateSibling actions.

Initial value:
                new Action(EastEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
                        @Override
                        public boolean isEnabled() {
                                return activeEditorPart instanceof IViewerProvider;
                        }

                        @Override
                        public void run() {
                                if (activeEditorPart instanceof IViewerProvider) {
                                        Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
                                        if (viewer != null) {
                                                viewer.refresh();
                                        }
                                }
                        }
                }

This action refreshes the viewer of the current editor if the editor implements org.eclipse.emf.common.ui.viewer.IViewerProvider.

This keeps track of the current selection provider.

Initial value:
                new Action(EastEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
                        @Override
                        public void run() {
                                try {
                                        getPage().showView("org.eclipse.ui.views.PropertySheet");
                                }
                                catch (PartInitException exception) {
                                        EastEditorPlugin.INSTANCE.log(exception);
                                }
                        }
                }

This action opens the Properties view.