Runtime

org.eclipse.gmf.runtime.common.ui.action
Class ActionMenuManager.MenuCreatorAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.ui.actions.PartEventAction
                  extended byorg.eclipse.ui.actions.RetargetAction
                      extended byorg.eclipse.ui.actions.LabelRetargetAction
                          extended byorg.eclipse.gmf.runtime.common.ui.action.ActionMenuManager.MenuCreatorAction
All Implemented Interfaces:
ActionFactory.IWorkbenchAction, IAction, IMenuCreator, IPartListener
Enclosing class:
ActionMenuManager

public class ActionMenuManager.MenuCreatorAction
extends LabelRetargetAction
implements IMenuCreator

An action that provides a menu and fills it from the contribution items of the enclosing menu manager. It also retargets to the manager's supplied action handler.


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
ActionMenuManager.MenuCreatorAction(IAction actionHandler)
          Creates a new menu creator action
 
Method Summary
protected  Menu createMenu(Menu mnu)
          Create the drop-down/pop-up menu.
 void dispose()
           
 Menu getMenu(Control parent)
           
 Menu getMenu(Menu parent)
           
protected  void propagateChange(PropertyChangeEvent event)
          Ignores the action handler's "enable" event since "enablement" is determined by the sub-action(s) enablement state
 void run()
          Only run the action handler if it is enabled
 void runWithEvent(Event event)
          Only run the action handler if it is enabled
protected  void setActionHandler(IAction handler)
          Ignores the action handler's "enable" event since "enablement" is determined by the sub-action(s)
 
Methods inherited from class org.eclipse.ui.actions.LabelRetargetAction
setDisabledImageDescriptor, setHoverImageDescriptor, setImageDescriptor, setText, setToolTipText
 
Methods inherited from class org.eclipse.ui.actions.RetargetAction
enableAccelerator, getAccelerator, getActionHandler, isHandled, partActivated, partClosed, partDeactivated, setChecked, setHelpListener, toString
 
Methods inherited from class org.eclipse.ui.actions.PartEventAction
getActivePart, partBroughtToTop, partOpened
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setDescription, setEnabled, setId, setMenuCreator
 
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, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, removePropertyChangeListener, setAccelerator, setActionDefinitionId, setDescription, setEnabled, setId, setMenuCreator
 

Constructor Detail

ActionMenuManager.MenuCreatorAction

public ActionMenuManager.MenuCreatorAction(IAction actionHandler)
Creates a new menu creator action

Parameters:
actionHandler - the action handler
Method Detail

getMenu

public Menu getMenu(Control parent)
Specified by:
getMenu in interface IMenuCreator

getMenu

public Menu getMenu(Menu parent)
Specified by:
getMenu in interface IMenuCreator

dispose

public void dispose()
Specified by:
dispose in interface IMenuCreator

createMenu

protected Menu createMenu(Menu mnu)
Create the drop-down/pop-up menu.

Parameters:
mnu - Menu for which to create the drop-down/pop-up menu
Returns:
Menu the drop-down/pop-up menu

propagateChange

protected void propagateChange(PropertyChangeEvent event)
Ignores the action handler's "enable" event since "enablement" is determined by the sub-action(s) enablement state


setActionHandler

protected void setActionHandler(IAction handler)
Ignores the action handler's "enable" event since "enablement" is determined by the sub-action(s)


run

public void run()
Only run the action handler if it is enabled

Specified by:
run in interface IAction

runWithEvent

public void runWithEvent(Event event)
Only run the action handler if it is enabled

Specified by:
runWithEvent in interface IAction

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.