|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.action.ContributionItem | +--org.eclipse.jface.action.ActionContributionItem
A contribution item which delegates to an action.
This class may be instantiated; it is not intended to be subclassed.
Constructor Summary | |
ActionContributionItem(IAction action)
Creates a new contribution item from the given action. |
Method Summary | |
boolean |
equals(Object o)
Compares this action contribution item with another object. |
void |
fill(Composite parent)
The ActionContributionItem implementation of this
IContributionItem method creates an SWT Button for
the action using the action's style. |
void |
fill(Menu parent,
int index)
The ActionContributionItem implementation of this
IContributionItem method creates an SWT MenuItem
for the action using the action's style. |
void |
fill(ToolBar parent,
int index)
The ActionContributionItem implementation of this ,
IContributionItem method creates an SWT ToolItem
for the action using the action's style. |
IAction |
getAction()
Returns the action associated with this contribution item. |
static boolean |
getUseColorIconsInToolbars()
Returns whether color icons should be used in toolbars. |
int |
hashCode()
|
boolean |
isDynamic()
The action item implementation of this IContributionItem
method returns true for menu items and false
for everything else. |
boolean |
isEnabled()
The default implementation of this IContributionItem
method returns true . |
protected boolean |
isEnabledAllowed()
Returns true if this item is allowed to enable,
false otherwise. |
static void |
setUseColorIconsInToolbars(boolean useColorIcons)
Sets whether color icons should be used in toolbars. |
void |
update()
The action item implementation of this IContributionItem
method calls update(null) . |
void |
update(String propertyName)
Synchronizes the UI with the given property. |
Methods inherited from class org.eclipse.jface.action.ContributionItem |
dispose, getId, getParent, isDirty, isGroupMarker, isSeparator, isVisible, setParent, setVisible, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ActionContributionItem(IAction action)
action
- the actionMethod Detail |
public static boolean getUseColorIconsInToolbars()
true
if color icons should be used in toolbars,
false
otherwisepublic static void setUseColorIconsInToolbars(boolean useColorIcons)
useColorIcons
- true
if color icons should be used in toolbars,
false
otherwisepublic boolean equals(Object o)
equals
in class Object
public void fill(Composite parent)
ActionContributionItem
implementation of this
IContributionItem
method creates an SWT Button
for
the action using the action's style. If the action's checked property has
been set, the button is created and primed to the value of the checked
property.fill
in class ContributionItem
org.eclipse.jface.action.IContributionItem
parent
- the parent controlpublic void fill(Menu parent, int index)
ActionContributionItem
implementation of this
IContributionItem
method creates an SWT MenuItem
for the action using the action's style. If the action's checked property has
been set, a button is created and primed to the value of the checked
property. If the action's menu creator property has been set, a cascading
submenu is created.fill
in class ContributionItem
org.eclipse.jface.action.IContributionItem
parent
- the parent menuindex
- the index where the controls are inserted,
or -1
to insert at the endpublic void fill(ToolBar parent, int index)
ActionContributionItem
implementation of this ,
IContributionItem
method creates an SWT ToolItem
for the action using the action's style. If the action's checked property has
been set, a button is created and primed to the value of the checked
property. If the action's menu creator property has been set, a drop-down
tool item is created.fill
in class ContributionItem
org.eclipse.jface.action.IContributionItem
parent
- the parent tool barindex
- the index where the controls are inserted,
or -1
to insert at the endpublic IAction getAction()
public int hashCode()
hashCode
in class Object
public boolean isEnabled()
ContributionItem
IContributionItem
method returns true
. Subclasses may override.isEnabled
in class ContributionItem
org.eclipse.jface.action.IContributionItem
true
if this item is enabledpublic boolean isDynamic()
IContributionItem
method returns true
for menu items and false
for everything else.isDynamic
in class ContributionItem
org.eclipse.jface.action.IContributionItem
true
if this item is dynamic, and
false
for normal itemsprotected boolean isEnabledAllowed()
true
if this item is allowed to enable,
false
otherwise.public final void update()
IContributionItem
method calls update(null)
.update
in class ContributionItem
public void update(String propertyName)
update
in class ContributionItem
propertyName
- the name of the property, or null
meaning all applicable
properties
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |