Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.menus
Interface IMenuService

All Superinterfaces:
IDisposable, IServiceWithSources

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);
 
  • 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
 void addContributionFactory ( AbstractContributionFactory factory)
          Contribute and initialize the contribution factory.
  IEvaluationContext getCurrentState ()
          Get the current state of eclipse as seen by the menu service.
 void populateContributionManager ( ContributionManager mgr, String location)
          Populate a ContributionManager at the specified starting location with a set of IContributionItemss.
 void releaseContributions ( ContributionManager mgr)
          Before calling dispose() on a ContributionManager populated by the menu service, you must inform the menu service to release its contributions.
 void removeContributionFactory ( AbstractContributionFactory factory)
          Remove the contributed factory from the menu service.
 
Methods inherited from interface org.eclipse.ui.services. IServiceWithSources
addSourceProvider, removeSourceProvider
 
Methods inherited from interface org.eclipse.ui.services. IDisposable
dispose
 

Method Detail

addContributionFactory

void addContributionFactory(
AbstractContributionFactory factory)
Contribute and initialize the contribution factory. This should only be called once per factory. After the call, the factory should be treated as an unmodifiable object.

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.

Parameters:
factory - the contribution factory. Must not be null
See Also:
removeContributionFactory(AbstractContributionFactory)

removeContributionFactory

void removeContributionFactory(
AbstractContributionFactory factory)
Remove the contributed factory from the menu service. If the factory is not contained by this service, this call does nothing.

Parameters:
factory - the contribution factory to remove. Must not be null.

populateContributionManager

void populateContributionManager(
ContributionManager mgr,
                                 
String location)
Populate a ContributionManager at the specified starting location with a set of IContributionItemss. It applies AbstractContributionFactorys that are stored against the provided location.

Parameters:
mgr - The ContributionManager to populate
location - The starting location to begin populating this contribution manager. The format is the Menu API URI format.
See Also:
releaseContributions(ContributionManager)

releaseContributions

void releaseContributions(
ContributionManager mgr)
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 to populateContributionManager(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:
ISources, IEvaluationService

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire