Package org.eclipse.ui.menus
Class CommandContributionItemParameter
- java.lang.Object
-
- org.eclipse.ui.menus.CommandContributionItemParameter
-
public class CommandContributionItemParameter extends Object
A help class for the various parameters that can be used with command contributions. Mandatory parameters are in the constructor, and public fields can be set to fill in other parameters.- Since:
- 3.4
-
-
Field Summary
Fields Modifier and Type Field Description String
commandId
A command id for a defined command.ImageDescriptor
disabledIcon
A disabled icon for this item.String
helpContextId
The help context id to be applied to this contribution.ImageDescriptor
hoverIcon
A hover icon for this item.ImageDescriptor
icon
An icon for this item.String
iconStyle
The icon style to use.String
id
The id for this item.String
label
A label for this item.String
mnemonic
A mnemonic for this item to be applied to the label.int
mode
Any number of mode bits, likeCommandContributionItem.MODE_FORCE_TEXT
.Map
parameters
A map of strings to strings which represent parameter names to values.IServiceLocator
serviceLocator
a service locator that is most appropriate for this contribution.int
style
The style of this menu contribution.String
tooltip
A tooltip for this item.boolean
visibleEnabled
The visibility tracking for a menu contribution.
-
Constructor Summary
Constructors Constructor Description CommandContributionItemParameter(IServiceLocator serviceLocator, String id, String commandId, int style)
Create the parameter object.CommandContributionItemParameter(IServiceLocator serviceLocator, String id, String commandId, Map parameters, ImageDescriptor icon, ImageDescriptor disabledIcon, ImageDescriptor hoverIcon, String label, String mnemonic, String tooltip, int style, String helpContextId, boolean visibleEnabled)
Build the parameter object.
-
-
-
Field Detail
-
serviceLocator
public IServiceLocator serviceLocator
a service locator that is most appropriate for this contribution. Typically the localIWorkbenchWindow
orIWorkbenchPartSite
will be sufficient. Must not benull
.
-
id
public String id
The id for this item. May benull
. Items without an id cannot be referenced later.
-
commandId
public String commandId
A command id for a defined command. Must not benull
.
-
parameters
public Map parameters
A map of strings to strings which represent parameter names to values. The parameter names must match those in the command definition. May benull
-
icon
public ImageDescriptor icon
An icon for this item. May benull
.
-
disabledIcon
public ImageDescriptor disabledIcon
A disabled icon for this item. May benull
.
-
hoverIcon
public ImageDescriptor hoverIcon
A hover icon for this item. May benull
.
-
label
public String label
A label for this item. May benull
.
-
mnemonic
public String mnemonic
A mnemonic for this item to be applied to the label. May benull
.
-
tooltip
public String tooltip
A tooltip for this item. May benull
. Tooltips are currently only valid for toolbar contributions.
-
style
public int style
The style of this menu contribution. See the CommandContributionItem STYLE_* contants.
-
helpContextId
public String helpContextId
The help context id to be applied to this contribution. May benull
-
iconStyle
public String iconStyle
The icon style to use. May benull
for default style.- See Also:
ICommandImageService
-
visibleEnabled
public boolean visibleEnabled
The visibility tracking for a menu contribution.
-
mode
public int mode
Any number of mode bits, likeCommandContributionItem.MODE_FORCE_TEXT
.
-
-
Constructor Detail
-
CommandContributionItemParameter
public CommandContributionItemParameter(IServiceLocator serviceLocator, String id, String commandId, int style)
Create the parameter object. Nullable attributes can be set directly.- Parameters:
serviceLocator
- a service locator that is most appropriate for this contribution. Typically the localIWorkbenchWindow
orIWorkbenchPartSite
will be sufficient. Must not benull
.id
- The id for this item. May benull
. Items without an id cannot be referenced later.commandId
- A command id for a defined command. Must not benull
.style
- The style of this menu contribution. See the STYLE_* contants.
-
CommandContributionItemParameter
public CommandContributionItemParameter(IServiceLocator serviceLocator, String id, String commandId, Map parameters, ImageDescriptor icon, ImageDescriptor disabledIcon, ImageDescriptor hoverIcon, String label, String mnemonic, String tooltip, int style, String helpContextId, boolean visibleEnabled)
Build the parameter object.Note: This constructor should not be called outside the framework.
- Parameters:
serviceLocator
- a service locator that is most appropriate for this contribution. Typically the localIWorkbenchWindow
orIWorkbenchPartSite
will be sufficient. Must not benull
.id
- The id for this item. May benull
. Items without an id cannot be referenced later.commandId
- A command id for a defined command. Must not benull
.parameters
- A map of strings to strings which represent parameter names to values. The parameter names must match those in the command definition. May benull
icon
- An icon for this item. May benull
.disabledIcon
- A disabled icon for this item. May benull
.hoverIcon
- A hover icon for this item. May benull
.label
- A label for this item. May benull
.mnemonic
- A mnemonic for this item to be applied to the label. May benull
.tooltip
- A tooltip for this item. May benull
. Tooltips are currently only valid for toolbar contributions.style
- The style of this menu contribution. See the STYLE_* contants.helpContextId
- the help context id to be applied to this contribution. May benull
visibleEnabled
- Visibility tracking for the menu contribution.- Restriction:
- This constructor is not intended to be referenced by clients.
-
-