de.cau.cs.kieler.sim.kiem.ui
Class DropDownAction

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by de.cau.cs.kieler.sim.kiem.ui.DropDownAction
All Implemented Interfaces:
IAction, IMenuCreator

public class DropDownAction
extends Action
implements IMenuCreator

The Class DropDownAction. This is a helper class that simplifies the creation of drop down actions, by adding simple Actions. A DropDownAction always has a default Action which it refers to in the standard behavior. It will always be displayed first in the list. The list can not only contain Actions but also Separators for example.

Rating proposed yellow
(2009-01-15)

Field Summary
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
DropDownAction(Action defaultActionParam)
          Instantiates a new drop down action.
 
Method Summary
 void add(Action action)
          Adds an Action to the DropDownAction.
 void add(IContributionItem contributionItem)
          Adds a ContributionItem (e.g., a Separator) to the DropDownAction.
protected  void addActionToMenu(Menu parent, Action action)
          Adds an Action item to menu of the DropDownAction.
protected  void addContributionItemToMenu(Menu parent, IContributionItem citem)
          Adds an IContributionItem item to menu of the DropDownAction.
 void dispose()
          
 Menu getMenu(Control parent)
          
 Menu getMenu(Menu parent)
          
 void run()
           
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

DropDownAction

public DropDownAction(Action defaultActionParam)
Instantiates a new drop down action. This always has a default Action that is the first action in the drop down menu. The DropDownAction inherits the icon, action, text, enableness and the visibility from this default Action.

Parameters:
defaultActionParam - the default Action
Method Detail

addActionToMenu

protected void addActionToMenu(Menu parent,
                               Action action)
Adds an Action item to menu of the DropDownAction.

Parameters:
parent - the parent
action - the action

addContributionItemToMenu

protected void addContributionItemToMenu(Menu parent,
                                         IContributionItem citem)
Adds an IContributionItem item to menu of the DropDownAction.

Parameters:
parent - the parent
citem - the citem

run

public void run()
Specified by:
run in interface IAction
Overrides:
run in class Action

add

public void add(Action action)
Adds an Action to the DropDownAction.

Parameters:
action - the Action to add

add

public void add(IContributionItem contributionItem)
Adds a ContributionItem (e.g., a Separator) to the DropDownAction.

Parameters:
contributionItem - the IContributionItem to add

dispose

public void dispose()

Specified by:
dispose in interface IMenuCreator

getMenu

public Menu getMenu(Menu parent)

Specified by:
getMenu in interface IMenuCreator

getMenu

public Menu getMenu(Control parent)

Specified by:
getMenu in interface IMenuCreator