org.eclipse.gef.internal.ui.palette
Class ToolbarDropdownContributionItem

java.lang.Object
  extended byorg.eclipse.jface.action.ContributionItem
      extended byorg.eclipse.gef.internal.ui.palette.ToolbarDropdownContributionItem
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem

public class ToolbarDropdownContributionItem
extends org.eclipse.jface.action.ContributionItem

A contribution item which delegates to an action.

This class may be instantiated; it is not intended to be subclassed.


Constructor Summary
ToolbarDropdownContributionItem(org.eclipse.jface.action.IAction action)
          Creates a new contribution item from the given action.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares this action contribution item with another object.
 void fill(org.eclipse.swt.widgets.Composite parent)
          The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT Button for the action.
 void fill(org.eclipse.swt.widgets.Menu parent, int index)
          The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT MenuItem for the action.
 void fill(org.eclipse.swt.widgets.ToolBar parent, int index)
          The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT ToolItem for the action.
 org.eclipse.jface.action.IAction getAction()
          Returns the action associated with this contribution item.
 int hashCode()
           
 boolean isDynamic()
          The action item implementation of this IContributionItem method returns true for menu items and false for everything else.
 boolean isEnabled()
           
protected  boolean isEnabledAllowed()
          Returns true if this item is allowed to enable, false otherwise.
 void update()
          The action item implementation of this IContributionItem method calls update(null).
 void update(java.lang.String propertyName)
          Synchronizes the UI with the given property.
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, getId, getParent, isDirty, isGroupMarker, isSeparator, isVisible, saveWidgetState, setParent, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToolbarDropdownContributionItem

public ToolbarDropdownContributionItem(org.eclipse.jface.action.IAction action)
Creates a new contribution item from the given action. The id of the action is used as the id of the item.

Parameters:
action - the action
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares this action contribution item with another object. Two action contribution items are equal if they refer to the identical Action.


fill

public void fill(org.eclipse.swt.widgets.Composite parent)
The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT Button for the action. If the action's checked property has been set, a toggle button is created and primed to the value of the checked property.


fill

public void fill(org.eclipse.swt.widgets.Menu parent,
                 int index)
The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT MenuItem for the action. If the action's checked property has been set, a toggle 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

public void fill(org.eclipse.swt.widgets.ToolBar parent,
                 int index)
The ToolbarDropdownContributionItem implementation of this IContributionItem method creates a SWT ToolItem for the action. If the action's checked property has been set, a toggle 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.


getAction

public org.eclipse.jface.action.IAction getAction()
Returns the action associated with this contribution item.

Returns:
the action

hashCode

public int hashCode()

isEnabled

public boolean isEnabled()

isDynamic

public boolean isDynamic()
The action item implementation of this IContributionItem method returns true for menu items and false for everything else.


isEnabledAllowed

protected boolean isEnabledAllowed()
Returns true if this item is allowed to enable, false otherwise.

Returns:
if this item is allowed to be enabled
Since:
2.0

update

public final void update()
The action item implementation of this IContributionItem method calls update(null).


update

public void update(java.lang.String propertyName)
Synchronizes the UI with the given property.

Parameters:
propertyName - the name of the property, or null meaning all applicable properties