net.sf.doolin.gui.action.swing
Class DefaultActionFactory

java.lang.Object
  extended by net.sf.doolin.gui.action.swing.DefaultActionFactory
All Implemented Interfaces:
ActionFactory

public class DefaultActionFactory
extends Object
implements ActionFactory

Default action factory used in the Doolin GUI framework. It can be replaced by declaring in the Spring configuration a bean that implements the ActionFactory interface.

Author:
Damien Coraboeuf

Field Summary
static DefaultActionFactory INSTANCE
          Default instance
 
Constructor Summary
DefaultActionFactory()
           
 
Method Summary
 Action createAction(ActionContext actionContext, GUIAction action, IconSize iconSize)
          Creates a Swing Action from a GUIAction.
 JButtonBar createButtonBar(ActionBarContext actionBarContext)
          Creates a button bar from a list of actions
 JMenuBar createMenuBar(ActionContextPathList menuBarContext)
          Creates a menu bar
 JPopupMenu createPopupMenu(ActionBarContext actionBarContext)
          Creates a pop-up menu from an action group.
 JToolBar createToolBar(ActionBarContext actionBarContext)
          Creates a tool bar from an action group.
 void installAction(MenuBuilder menuBuilder, ActionPath actionPath, ActionContext actionContext)
          Installs an action path
protected  void installAction(MenuBuilder menuBuilder, Stack<String> pathStack, ActionPath actionPath, ActionContext actionContext)
          Installs an action defined by its path into a MenuBuilder.
protected  void installActionPaths(MenuBuilder menuBuilder, ActionBarContext actionBarContext)
          Installs the actions defined by an ActionBarContext into the MenuBuilder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultActionFactory INSTANCE
Default instance

Constructor Detail

DefaultActionFactory

public DefaultActionFactory()
Method Detail

createAction

public Action createAction(ActionContext actionContext,
                           GUIAction action,
                           IconSize iconSize)
Description copied from interface: ActionFactory
Creates a Swing Action from a GUIAction.

Specified by:
createAction in interface ActionFactory
Parameters:
actionContext - Action context
action - Associated GUIAction
iconSize - Desired icon size
Returns:
Swing Action

createMenuBar

public JMenuBar createMenuBar(ActionContextPathList menuBarContext)
Description copied from interface: ActionFactory
Creates a menu bar

Specified by:
createMenuBar in interface ActionFactory
Parameters:
menuBarContext - Menu bar description
Returns:
Menu bar

installActionPaths

protected void installActionPaths(MenuBuilder menuBuilder,
                                  ActionBarContext actionBarContext)
Installs the actions defined by an ActionBarContext into the MenuBuilder.

Parameters:
menuBuilder - Menu builder to call
actionBarContext - Definition of the action bar

installAction

public void installAction(MenuBuilder menuBuilder,
                          ActionPath actionPath,
                          ActionContext actionContext)
Description copied from interface: ActionFactory
Installs an action path

Specified by:
installAction in interface ActionFactory
Parameters:
menuBuilder - Menu builder
actionPath - Action path to install
actionContext - Action context

installAction

protected void installAction(MenuBuilder menuBuilder,
                             Stack<String> pathStack,
                             ActionPath actionPath,
                             ActionContext actionContext)
Installs an action defined by its path into a MenuBuilder.

Parameters:
menuBuilder - Menu builder to call
pathStack - Path to the action
actionPath - Definition to the action
actionContext - Action context
See Also:
ActionPath.install(MenuBuilder, ActionFactory, ActionContext)

createToolBar

public JToolBar createToolBar(ActionBarContext actionBarContext)
Description copied from interface: ActionFactory
Creates a tool bar from an action group.

Specified by:
createToolBar in interface ActionFactory
Parameters:
actionBarContext - The action bar context
Returns:
Tool bar

createButtonBar

public JButtonBar createButtonBar(ActionBarContext actionBarContext)
Description copied from interface: ActionFactory
Creates a button bar from a list of actions

Specified by:
createButtonBar in interface ActionFactory
Parameters:
actionBarContext - The action bar context
Returns:
Button bar

createPopupMenu

public JPopupMenu createPopupMenu(ActionBarContext actionBarContext)
Description copied from interface: ActionFactory
Creates a pop-up menu from an action group.

Specified by:
createPopupMenu in interface ActionFactory
Parameters:
actionBarContext - The action bar context
Returns:
Pop-up menu


Copyright © 2011. All Rights Reserved.