Package org.eclipse.ui.internal
Class PluginActionBuilder.BasicContribution
java.lang.Object
org.eclipse.ui.internal.PluginActionBuilder.BasicContribution
- Enclosing class:
- PluginActionBuilder
Helper class to collect the menus and actions defined within a contribution
element.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ArrayList<ActionDescriptor>
protected ArrayList<IConfigurationElement>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(ActionDescriptor desc) Add an action.protected void
addGroup
(IContributionManager mgr, String name) Adds a group to a contribution manager.void
addMenu
(IConfigurationElement element) Add a menu.void
contribute
(IMenuManager menu, boolean menuAppendIfMissing, IToolBarManager toolbar, boolean toolAppendIfMissing) Contributes submenus and/or actions into the provided menu and tool bar managers.protected void
contributeGroupMarker
(IMenuManager menu, IConfigurationElement element) Creates a named menu group marker from the information in the configuration element.protected void
contributeMenu
(IConfigurationElement menuElement, IMenuManager mng, boolean appendIfMissing) Creates a menu from the information in the menu configuration element and adds it into the provided menu manager.protected void
contributeMenuAction
(ActionDescriptor ad, IMenuManager menu, boolean appendIfMissing) Contributes action from action descriptor into the provided menu manager.protected void
contributeSeparator
(IMenuManager menu, IConfigurationElement element) Creates a named menu separator from the information in the configuration element.protected void
contributeToolbarAction
(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing) Contributes action from the action descriptor into the provided tool bar manager.void
dispose()
Disposes this contribution.protected void
Disposes the actions.protected void
insertAfter
(IContributionManager mgr, String refId, IContributionItem item) Inserts a contribution item after another named contribution item.protected void
insertAfter
(IContributionManager mgr, String refId, ActionDescriptor desc) Inserts an action after another named contribution item.protected void
insertMenuGroup
(IMenuManager menu, AbstractGroupMarker marker) Inserts the separator or group marker into the menu.
-
Field Details
-
actions
-
Constructor Details
-
BasicContribution
protected BasicContribution()
-
-
Method Details
-
addMenu
Add a menu.- Parameters:
element
- the element to base the menu on
-
addAction
Add an action.- Parameters:
desc
- the descriptor
-
contribute
public void contribute(IMenuManager menu, boolean menuAppendIfMissing, IToolBarManager toolbar, boolean toolAppendIfMissing) Contributes submenus and/or actions into the provided menu and tool bar managers. The elements added are filtered based on activity enablement.- Parameters:
menu
- the menu to contribute tomenuAppendIfMissing
- whether to append missing groups to menustoolbar
- the toolbar to contribute totoolAppendIfMissing
- whether to append missing groups to toolbars
-
contributeMenu
protected void contributeMenu(IConfigurationElement menuElement, IMenuManager mng, boolean appendIfMissing) Creates a menu from the information in the menu configuration element and adds it into the provided menu manager. If 'appendIfMissing' is true, and menu path slot is not found, it will be created and menu will be added into it. Otherwise, add operation will fail. -
contributeMenuAction
protected void contributeMenuAction(ActionDescriptor ad, IMenuManager menu, boolean appendIfMissing) Contributes action from action descriptor into the provided menu manager. -
contributeSeparator
Creates a named menu separator from the information in the configuration element. If the separator already exists do not create a second. -
contributeGroupMarker
Creates a named menu group marker from the information in the configuration element. If the marker already exists do not create a second. -
contributeToolbarAction
protected void contributeToolbarAction(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing) Contributes action from the action descriptor into the provided tool bar manager. -
insertMenuGroup
Inserts the separator or group marker into the menu. Subclasses may override. -
insertAfter
Inserts an action after another named contribution item. Subclasses may override. -
insertAfter
Inserts a contribution item after another named contribution item. Subclasses may override. -
addGroup
Adds a group to a contribution manager. Subclasses may override. -
dispose
public void dispose()Disposes this contribution.- Since:
- 3.1
-
disposeActions
protected void disposeActions()Disposes the actions.- Since:
- 3.1
-