Package org.eclipse.ui.actions
Class NewWizardMenu
- java.lang.Object
-
- org.eclipse.jface.action.ContributionItem
-
- org.eclipse.ui.actions.CompoundContributionItem
-
- org.eclipse.ui.actions.BaseNewWizardMenu
-
- org.eclipse.ui.actions.NewWizardMenu
-
- All Implemented Interfaces:
IContributionItem
public class NewWizardMenu extends BaseNewWizardMenu
ANewWizardMenu
augmentsBaseNewWizardMenu
with IDE-specific actions: New Project... (always shown) and New Example... (shown only if there are example wizards installed).Note: Clients must dispose this menu when it is no longer required.
-
-
Constructor Summary
Constructors Constructor Description NewWizardMenu(IMenuManager innerMgr, IWorkbenchWindow window, boolean register)
Deprecated.use NewWizardMenu(IWorkbenchWindow) insteadNewWizardMenu(IWorkbenchWindow window)
Creates a new wizard shortcut menu for the IDE.NewWizardMenu(IWorkbenchWindow window, String id)
Creates a new wizard shortcut menu for the IDE.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addItems(List<IContributionItem> list)
Adds the contribution items to show to the given list.void
deregisterListeners()
Deprecated.has no effectvoid
dispose()
The default implementation of thisIContributionItem
method does nothing.protected IContributionItem[]
getContributionItems()
Return a list of contributions items that will replace this item in the parent manager.boolean
isEnabled()
The default implementation of thisIContributionItem
method returnstrue
.void
setEnabled(boolean enabledValue)
Sets the enabled state of the receiver.-
Methods inherited from class org.eclipse.ui.actions.BaseNewWizardMenu
addShortcuts, getShowDialogAction, getWindow, registryHasCategory
-
Methods inherited from class org.eclipse.ui.actions.CompoundContributionItem
fill, isDirty, isDynamic, setParent
-
Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, fill, fill, getId, getParent, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setVisible, toString, update, update
-
-
-
-
Constructor Detail
-
NewWizardMenu
public NewWizardMenu(IWorkbenchWindow window)
Creates a new wizard shortcut menu for the IDE.Note: Clients must dispose this menu when it is no longer required.
- Parameters:
window
- the window containing the menu
-
NewWizardMenu
public NewWizardMenu(IWorkbenchWindow window, String id)
Creates a new wizard shortcut menu for the IDE.Note: Clients must dispose this menu when it is no longer required.
- Parameters:
window
- the window containing the menuid
- the identifier for this contribution item
-
NewWizardMenu
@Deprecated public NewWizardMenu(IMenuManager innerMgr, IWorkbenchWindow window, boolean register)
Deprecated.use NewWizardMenu(IWorkbenchWindow) insteadCreate a new wizard shortcut menu.If the menu will appear on a semi-permanent basis, for instance within a toolbar or menubar, the value passed for
register
should be true. If set, the menu will listen to perspective activation and update itself to suit. In this case clients are expected to callderegister
when the menu is no longer needed. This will unhook any perspective listeners.Note: Clients must dispose this menu when it is no longer required.
- Parameters:
innerMgr
- the location for the shortcut menu contentswindow
- the window containing the menuregister
- iftrue
the menu listens to perspective changes in the window
-
-
Method Detail
-
deregisterListeners
@Deprecated public void deregisterListeners()
Deprecated.has no effectRemoves all listeners from the containing workbench window.This method should only be called if the shortcut menu is created with
register = true
.
-
addItems
protected void addItems(List<IContributionItem> list)
Description copied from class:BaseNewWizardMenu
Adds the contribution items to show to the given list.- Overrides:
addItems
in classBaseNewWizardMenu
- Parameters:
list
- the list to add contribution items to
-
isEnabled
public boolean isEnabled()
Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method returnstrue
. Subclasses may override.- Specified by:
isEnabled
in interfaceIContributionItem
- Overrides:
isEnabled
in classContributionItem
- Returns:
true
if this item is enabled
-
setEnabled
public void setEnabled(boolean enabledValue)
Sets the enabled state of the receiver.- Parameters:
enabledValue
- iftrue
the menu is enabled; else it is disabled
-
getContributionItems
protected IContributionItem[] getContributionItems()
Description copied from class:CompoundContributionItem
Return a list of contributions items that will replace this item in the parent manager. The list must contain new contribution items every call since the old ones will be disposed.- Overrides:
getContributionItems
in classBaseNewWizardMenu
- Returns:
- an array list of items to display. Must not be
null
.
-
dispose
public void dispose()
Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method does nothing. Subclasses may override.- Specified by:
dispose
in interfaceIContributionItem
- Overrides:
dispose
in classBaseNewWizardMenu
-
-