Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.editor
Class SystemEditorActionContributionItem

java.lang.Object
  extended by ContributionItem
      extended by com.ibm.etools.systems.editor.SystemEditorActionContributionItem

public class SystemEditorActionContributionItem
extends ContributionItem

This class is a copy of the jface ActionContributionItem, with a slight modification to allow the Ctrl+SPACE to work for LPEX code assist. Otherwise, it gets eatten. * A contribution item which delegates to an action.

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


Constructor Summary
SystemEditorActionContributionItem(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 SystemEditorActionContributionItem implementation of this IContributionItem method creates an SWT Button for the action using the action's style.
 void fill(Menu parent, int index)
          The SystemEditorActionContributionItem implementation of this IContributionItem method creates an SWT MenuItem for the action using the action's style.
 void fill(ToolBar parent, int index)
          The SystemEditorActionContributionItem 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()
           
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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemEditorActionContributionItem

public SystemEditorActionContributionItem(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

getUseColorIconsInToolbars

public static boolean getUseColorIconsInToolbars()
Returns whether color icons should be used in toolbars.

Returns:
true if color icons should be used in toolbars, false otherwise

setUseColorIconsInToolbars

public static void setUseColorIconsInToolbars(boolean useColorIcons)
Sets whether color icons should be used in toolbars.

Parameters:
useColorIcons - true if color icons should be used in toolbars, false otherwise

equals

public boolean equals(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(Composite parent)
The SystemEditorActionContributionItem 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

public void fill(Menu parent,
                 int index)
The SystemEditorActionContributionItem 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

public void fill(ToolBar parent,
                 int index)
The SystemEditorActionContributionItem 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.


getAction

public 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(String propertyName)
Synchronizes the UI with the given property.

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

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.