Package org.eclipse.ui.actions
Class ContributionItemFactory
java.lang.Object
org.eclipse.ui.actions.ContributionItemFactory
Access to standard contribution items provided by the workbench.
 
Most of the functionality of this class is provided by static methods and fields. Example usage:
MenuManager menu = ...; IContributionItem reEdit = ContributionItemFactory.REOPEN_EDITORS.create(window); menu.add(reEdit);
Clients may declare subclasses that provide additional application-specific contribution item factories.
- Since:
- 3.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ContributionItemFactoryWorkbench contribution item (id "helpSearch"): An editable field for entering help search queries.static final ContributionItemFactoryWorkbench contribution item (id "newWizardShortlist"): A list of new item wizards available to be opened, arranged as a shortlist of promising new item wizards and an "Other" subitem.static final ContributionItemFactoryWorkbench contribution item (id "openWindows"): A list of windows currently open in the workbench.static final ContributionItemFactoryWorkbench contribution item (id "perspectivesShortlist"): A list of perspectives available to be opened, arranged as a shortlist of promising perspectives and an "Other" subitem.static final ContributionItemFactoryWorkbench action (id "pinEditor"): Toggle whether the editor is pinned.static final ContributionItemFactoryWorkbench contribution item (id "reopenEditors"): A list of recent editors (with inputs) available to be reopened in the window.static final ContributionItemFactoryWorkbench contribution item (id "viewsShortlist"): A list of views available to be opened in the window, arranged as a shortlist of promising views and an "Other" subitem.static final ContributionItemFactoryWorkbench contribution item (id "viewsShowIn"): A list of views available to be opened in the window, arranged as a list of alternate views to show the same item currently selected.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedContributionItemFactory(String contributionItemId) Creates a new workbench contribution item factory with the given id.
- 
Method SummaryModifier and TypeMethodDescriptionabstract IContributionItemcreate(IWorkbenchWindow window) Creates a new standard contribution item for the given workbench window.getId()Returns the id of this contribution item factory.
- 
Field Details- 
PIN_EDITORWorkbench action (id "pinEditor"): Toggle whether the editor is pinned. This action maintains its enablement state.
- 
OPEN_WINDOWSWorkbench contribution item (id "openWindows"): A list of windows currently open in the workbench. Selecting one of the items makes the corresponding window the active window. This action dynamically maintains the list of windows.
- 
VIEWS_SHORTLISTWorkbench contribution item (id "viewsShortlist"): A list of views available to be opened in the window, arranged as a shortlist of promising views and an "Other" subitem. Selecting one of the items opens the corresponding view in the active window. This action dynamically maintains the view shortlist.
- 
VIEWS_SHOW_INWorkbench contribution item (id "viewsShowIn"): A list of views available to be opened in the window, arranged as a list of alternate views to show the same item currently selected. Selecting one of the items opens the corresponding view in the active window. This action dynamically maintains the view list.
- 
REOPEN_EDITORSWorkbench contribution item (id "reopenEditors"): A list of recent editors (with inputs) available to be reopened in the window. Selecting one of the items reopens the corresponding editor on its input in the active window. This action dynamically maintains the list of editors.
- 
PERSPECTIVES_SHORTLISTWorkbench contribution item (id "perspectivesShortlist"): A list of perspectives available to be opened, arranged as a shortlist of promising perspectives and an "Other" subitem. Selecting one of the items makes the corresponding perspective active. Should a new perspective need to be opened, a workbench user preference controls whether the perspective is opened in the active window or a new window. This action dynamically maintains the perspectives shortlist.
- 
NEW_WIZARD_SHORTLISTWorkbench contribution item (id "newWizardShortlist"): A list of new item wizards available to be opened, arranged as a shortlist of promising new item wizards and an "Other" subitem. Selecting one of the items invokes the corresponding new item wizard. This action dynamically maintains the new item wizard shortlist.- Since:
- 3.1
 
- 
HELP_SEARCHWorkbench contribution item (id "helpSearch"): An editable field for entering help search queries.- Since:
- 3.1
 
 
- 
- 
Constructor Details- 
ContributionItemFactoryCreates a new workbench contribution item factory with the given id.- Parameters:
- contributionItemId- the id of contribution items created by this factory
 
 
- 
- 
Method Details- 
createCreates a new standard contribution item for the given workbench window.A typical contribution item automatically registers listeners against the workbench window so that it can keep its enablement state up to date. Ordinarily, the window's references to these listeners will be dropped automatically when the window closes. However, if the client needs to get rid of a contribution item while the window is still open, the client must call IContributionItem#dispose to give the item an opportunity to deregister its listeners and to perform any other cleanup. - Parameters:
- window- the workbench window
- Returns:
- the workbench contribution item
 
- 
getIdReturns the id of this contribution item factory.- Returns:
- the id of contribution items created by this factory
 
 
-