de.michab.mack
Class ActionManager

java.lang.Object
  extended byde.michab.mack.ActionManager

public class ActionManager
extends java.lang.Object

Manages an application's set of actions. The current main responsibility is to keep references to all existing application actions and to compute a popup menu and a menu bar.

See Also:
ConfigurableAction

Constructor Summary
ActionManager()
           
 
Method Summary
static void addAction(ConfigurableAction ca)
          Add an action to the ActionManager's set of managed actions.
static void doPopup(java.awt.event.MouseEvent me)
          Pops up a context menu on the component specified by the passed event.
static java.awt.Component getDefaultActionRoot()
          Returns the default root component for action driven dialogs.
static javax.swing.JMenuBar getMenuBar()
          Returns a reference to the menu bar holding the configured actions.
static javax.swing.JToolBar getToolbar()
          Returns a reference to the tool bar holding the configured actions.
static void initMenuSetup(java.util.ResourceBundle rb)
          Initiates initialisation of the ActionManager from the passed resources.
static void setDefaultActionRoot(java.awt.Component ar)
          Sets a default root component for action controlled dialogs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionManager

public ActionManager()
Method Detail

setDefaultActionRoot

public static void setDefaultActionRoot(java.awt.Component ar)
Sets a default root component for action controlled dialogs.

Parameters:
ar - The default root component for action controlled dialogs.

getDefaultActionRoot

public static java.awt.Component getDefaultActionRoot()
Returns the default root component for action driven dialogs. The default root has to be set by setDefaultActionRoot(). This is also somewhere available in Swing, but I cannot find it again.

Returns:
The default root component for action driven dialogs.

addAction

public static void addAction(ConfigurableAction ca)
Add an action to the ActionManager's set of managed actions.

Parameters:
ca - The action to add.

getMenuBar

public static javax.swing.JMenuBar getMenuBar()
Returns a reference to the menu bar holding the configured actions.

Returns:
A reference to the menu bar holding the configured actions.

getToolbar

public static javax.swing.JToolBar getToolbar()
Returns a reference to the tool bar holding the configured actions.

Returns:
A reference to the tool bar holding the configured actions.

initMenuSetup

public static void initMenuSetup(java.util.ResourceBundle rb)
Initiates initialisation of the ActionManager from the passed resources.

Parameters:
rb - The resources to be used for initialisation.

doPopup

public static void doPopup(java.awt.event.MouseEvent me)
Pops up a context menu on the component specified by the passed event.

Parameters:
me - The mouse event that was identified as a popup trigger.
Throws:
java.lang.InternalError - If not called on the event dispatch thread.