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
ANewWizardMenuaugmentsBaseNewWizardMenuwith 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 voidaddItems(List<IContributionItem> list)Adds the contribution items to show to the given list.voidderegisterListeners()Deprecated.has no effectvoiddispose()The default implementation of thisIContributionItemmethod does nothing.protected IContributionItem[]getContributionItems()Return a list of contributions items that will replace this item in the parent manager.booleanisEnabled()The default implementation of thisIContributionItemmethod returnstrue.voidsetEnabled(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
registershould be true. If set, the menu will listen to perspective activation and update itself to suit. In this case clients are expected to callderegisterwhen 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- iftruethe 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:BaseNewWizardMenuAdds the contribution items to show to the given list.- Overrides:
addItemsin classBaseNewWizardMenu- Parameters:
list- the list to add contribution items to
-
isEnabled
public boolean isEnabled()
Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod returnstrue. Subclasses may override.- Specified by:
isEnabledin interfaceIContributionItem- Overrides:
isEnabledin classContributionItem- Returns:
trueif this item is enabled
-
setEnabled
public void setEnabled(boolean enabledValue)
Sets the enabled state of the receiver.- Parameters:
enabledValue- iftruethe menu is enabled; else it is disabled
-
getContributionItems
protected IContributionItem[] getContributionItems()
Description copied from class:CompoundContributionItemReturn 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:
getContributionItemsin classBaseNewWizardMenu- Returns:
- an array list of items to display. Must not be
null.
-
dispose
public void dispose()
Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
disposein interfaceIContributionItem- Overrides:
disposein classBaseNewWizardMenu
-
-