public abstract class ContributionItemFactory extends Object
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.
Modifier and Type | Field and Description |
---|---|
static ContributionItemFactory |
HELP_SEARCH
Workbench contribution item (id "helpSearch"): An editable field
for entering help search queries.
|
static ContributionItemFactory |
NEW_WIZARD_SHORTLIST
Workbench 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 ContributionItemFactory |
OPEN_WINDOWS
Workbench contribution item (id "openWindows"): A list of windows
currently open in the workbench.
|
static ContributionItemFactory |
PERSPECTIVES_SHORTLIST
Workbench contribution item (id "perspectivesShortlist"): A list of
perspectives available to be opened, arranged as a shortlist of
promising perspectives and an "Other" subitem.
|
static ContributionItemFactory |
PIN_EDITOR
Workbench action (id "pinEditor"): Toggle whether the editor is pinned.
|
static ContributionItemFactory |
REOPEN_EDITORS
Workbench contribution item (id "reopenEditors"): A list of recent
editors (with inputs) available to be reopened in the window.
|
static ContributionItemFactory |
VIEWS_SHORTLIST
Workbench 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 ContributionItemFactory |
VIEWS_SHOW_IN
Workbench 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.
|
Modifier | Constructor and Description |
---|---|
protected |
ContributionItemFactory(String contributionItemId)
Creates a new workbench contribution item factory with the given id.
|
Modifier and Type | Method and Description |
---|---|
abstract IContributionItem |
create(IWorkbenchWindow window)
Creates a new standard contribution item for the given workbench window.
|
String |
getId()
Returns the id of this contribution item factory.
|
public static final ContributionItemFactory PIN_EDITOR
public static final ContributionItemFactory OPEN_WINDOWS
public static final ContributionItemFactory VIEWS_SHORTLIST
public static final ContributionItemFactory VIEWS_SHOW_IN
public static final ContributionItemFactory REOPEN_EDITORS
public static final ContributionItemFactory PERSPECTIVES_SHORTLIST
public static final ContributionItemFactory NEW_WIZARD_SHORTLIST
public static final ContributionItemFactory HELP_SEARCH
protected ContributionItemFactory(String contributionItemId)
contributionItemId
- the id of contribution items created by this factorypublic abstract IContributionItem create(IWorkbenchWindow 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.
window
- the workbench windowpublic String getId()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.