public interface IMenuService extends 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);
|Modifier and Type||Method and Description|
Contribute and initialize the contribution factory.
Get the current state of eclipse as seen by the menu service.
Before calling dispose() on a ContributionManager populated by the menu service, you must inform the menu service to release its contributions.
Remove the contributed factory from the menu service.
void addContributionFactory(AbstractContributionFactory factory)
Note: factories should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.
factory- the contribution factory. Must not be
void removeContributionFactory(AbstractContributionFactory factory)
factory- the contribution factory to remove. Must not be
void populateContributionManager(ContributionManager mgr, String location)
ContributionManagerat the specified starting location with a set of
IContributionItemss. It applies
AbstractContributionFactorys that are stored against the provided location.
mgr- The ContributionManager to populate
location- The starting location to begin populating this contribution manager. The format is the Menu API URI format.
void releaseContributions(ContributionManager mgr)
This will not update the ContributionManager (and any widgets). It will simply remove all menu service references to the contents of this ContributionManager.
mgr- The manager that was populated by a call to
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.