|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.action.ContributionItem
org.eclipse.ui.menus.CommandContributionItem
public class CommandContributionItem
A contribution item which delegates to a command. It can be used in AbstractContributionFactory.createContributionItems(IServiceLocator,
IContributionRoot).
It currently supports placement in menus and toolbars.
This class may be instantiated; it is not intended to be subclassed.
| Field Summary | |
|---|---|
static int |
MODE_FORCE_TEXT
Mode bit: Show text on tool items or buttons, even if an image is present. |
static int |
STYLE_CHECK
A checked tool item or menu item. |
static int |
STYLE_PULLDOWN
A ToolBar pulldown item. |
static int |
STYLE_PUSH
A push button tool item or menu item. |
static int |
STYLE_RADIO
A radio-button style menu item. |
| Constructor Summary | |
|---|---|
CommandContributionItem(CommandContributionItemParameter contributionParameters)
Create a CommandContributionItem to place in a ContributionManager. |
|
CommandContributionItem(IServiceLocator serviceLocator,
java.lang.String id,
java.lang.String commandId,
java.util.Map parameters,
ImageDescriptor icon,
ImageDescriptor disabledIcon,
ImageDescriptor hoverIcon,
java.lang.String label,
java.lang.String mnemonic,
java.lang.String tooltip,
int style)
Deprecated. create the CommandContributionItemParameter |
|
| Method Summary | |
|---|---|
void |
dispose()
The default implementation of this IContributionItem
method does nothing. |
void |
fill(Composite parent)
The default implementation of this IContributionItem
method does nothing. |
void |
fill(Menu parent,
int index)
The default implementation of this IContributionItem
method does nothing. |
void |
fill(ToolBar parent,
int index)
The default implementation of this IContributionItem
method does nothing. |
ParameterizedCommand |
getCommand()
Returns the ParameterizedCommand for this contribution. |
boolean |
isEnabled()
The default implementation of this IContributionItem
method returns true. |
boolean |
isVisible()
The default implementation of this IContributionItem
method returns the value recorded in an internal state variable,
which is true by default. |
void |
update()
The default implementation of this IContributionItem
method does nothing. |
void |
update(java.lang.String id)
The ContributionItem implementation of this
method declared on IContributionItem does nothing. |
| Methods inherited from class org.eclipse.jface.action.ContributionItem |
|---|
fill, getId, getParent, isDirty, isDynamic, isGroupMarker, isSeparator, saveWidgetState, setId, setParent, setVisible, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int STYLE_PUSH
public static final int STYLE_CHECK
public static final int STYLE_RADIO
public static final int STYLE_PULLDOWN
public static int MODE_FORCE_TEXT
| Constructor Detail |
|---|
public CommandContributionItem(CommandContributionItemParameter contributionParameters)
contributionParameters - parameters necessary to render this contribution item.
public CommandContributionItem(IServiceLocator serviceLocator,
java.lang.String id,
java.lang.String commandId,
java.util.Map parameters,
ImageDescriptor icon,
ImageDescriptor disabledIcon,
ImageDescriptor hoverIcon,
java.lang.String label,
java.lang.String mnemonic,
java.lang.String tooltip,
int style)
CommandContributionItemParameter
serviceLocator - a service locator that is most appropriate for this contribution.
Typically the local IWorkbenchWindow or IWorkbenchPartSite will be sufficient.id - The id for this item. May be null. Items without an id
cannot be referenced later.commandId - A command id for a defined command. Must not be null.parameters - A map of strings to strings which represent parameter names to
values. The parameter names must match those in the command
definition.icon - An icon for this item. May be null.disabledIcon - A disabled icon for this item. May be null.hoverIcon - A hover icon for this item. May be null.label - A label for this item. May be null.mnemonic - A mnemonic for this item to be applied to the label. May be
null.tooltip - A tooltip for this item. May be null. Tooltips are
currently only valid for toolbar contributions.style - The style of this menu contribution. See the STYLE_* contants.| Method Detail |
|---|
public ParameterizedCommand getCommand()
NOTE: The returned object should be treated as 'read-only', do not execute this instance or attempt to modify its state.
public void fill(Menu parent,
int index)
ContributionItemIContributionItem
method does nothing. Subclasses may override.
fill in interface IContributionItemfill in class ContributionItemparent - the parent menuindex - the index where the controls are inserted,
or -1 to insert at the endpublic void fill(Composite parent)
ContributionItemIContributionItem
method does nothing. Subclasses may override.
fill in interface IContributionItemfill in class ContributionItemparent - the parent control
public void fill(ToolBar parent,
int index)
ContributionItemIContributionItem
method does nothing. Subclasses may override.
fill in interface IContributionItemfill in class ContributionItemparent - the parent tool barindex - the index where the controls are inserted,
or -1 to insert at the endpublic void update()
ContributionItemIContributionItem
method does nothing. Subclasses may override.
update in interface IContributionItemupdate in class ContributionItempublic void update(java.lang.String id)
ContributionItemContributionItem implementation of this
method declared on IContributionItem does nothing.
Subclasses should override to update their state.
update in interface IContributionItemupdate in class ContributionItemid - the id of the changed propertypublic void dispose()
ContributionItemIContributionItem
method does nothing. Subclasses may override.
dispose in interface IContributionItemdispose in class ContributionItempublic boolean isEnabled()
ContributionItemIContributionItem
method returns true. Subclasses may override.
isEnabled in interface IContributionItemisEnabled in class ContributionItemtrue if this item is enabledpublic boolean isVisible()
ContributionItemIContributionItem
method returns the value recorded in an internal state variable,
which is true by default. setVisible
should be used to change this setting.
isVisible in interface IContributionItemisVisible in class ContributionItemtrue if this item is visible, and
false otherwise
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.