Package org.eclipse.ui.menus
Interface IMenuService
- All Superinterfaces:
IDisposable
,IServiceWithSources
Provides services related to the menu architecture within the workbench. It can be used to contribute additional items to the menu, tool bar and status line.
This service can be acquired from your service locator:
IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
- This service is available globally.
- Since:
- 3.3
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Contribute and initialize the contribution factory.Get the current state of eclipse as seen by the menu service.void
populateContributionManager
(ContributionManager mgr, String location) Populate aContributionManager
at the specified starting location with a set ofIContributionItems
s.void
Before calling dispose() on a ContributionManager populated by the menu service, you must inform the menu service to release its contributions.void
Remove the contributed factory from the menu service.Methods inherited from interface org.eclipse.ui.services.IDisposable
dispose
Methods inherited from interface org.eclipse.ui.services.IServiceWithSources
addSourceProvider, removeSourceProvider
-
Method Details
-
populateContributionManager
Populate aContributionManager
at the specified starting location with a set ofIContributionItems
s. It appliesAbstractContributionFactory
s that are stored against the provided location.- Parameters:
mgr
- The ContributionManager to populatelocation
- The starting location to begin populating this contribution manager. The format is the Menu API URI format.- See Also:
-
releaseContributions
Before calling dispose() on a ContributionManager populated by the menu service, you must inform the menu service to release its contributions. This takes care of unregistering any IContributionItems that have their visibleWhen clause managed by this menu service.This will not update the ContributionManager (and any widgets). It will simply remove all menu service references to the contents of this ContributionManager.
- Parameters:
mgr
- The manager that was populated by a call topopulateContributionManager(ContributionManager, String)
-
getCurrentState
IEvaluationContext getCurrentState()Get the current state of eclipse as seen by the menu service.- Returns:
- an IEvaluationContext containing state variables.
- See Also: