Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.gui.mgraph.actions
Class ActionFactory  view ActionFactory download ActionFactory.java

java.lang.Object
  extended byorg.modama.gui.mgraph.actions.ActionFactory

public class ActionFactory
extends java.lang.Object

A static Class to process actions First you have to tell ActionFactory what actions are available. Then, a call to createXXX will make the real stuff and returns, whatever is needed.


Nested Class Summary
protected static class ActionFactory.JMenuGenerator
           
protected static class ActionFactory.JPopupMenuGenerator
           
protected static class ActionFactory.JToolBarGenerator
           
protected static class ActionFactory.MenuGenerator
           
 
Field Summary
protected static java.util.HashMap allActions
          all registered actions
protected static org.apache.log4j.Logger logger
          error logger
 
Constructor Summary
ActionFactory()
           
 
Method Summary
static javax.swing.JMenu createMenu(java.lang.Class o)
          creates a JMenu structure for given Object.
static javax.swing.JMenu createMenu(java.lang.Object o)
           
protected static void createMenuItems(java.lang.String className, ActionFactory.MenuGenerator mg)
          creates an the Menu wih help of a MenuGenerator this will look up to the resources file, extract the value for: actions.[className] and parse it and delegate the real action to the MenuGenerator-Instance
static javax.swing.JPopupMenu createPopupMenu(java.lang.Class o)
          creates a JPopupMenu structure for given Object.
static javax.swing.JPopupMenu createPopupMenu(java.lang.Object o)
           
static javax.swing.JToolBar createToolBar(java.lang.Class o)
           
static javax.swing.JToolBar createToolBar(java.lang.Object o)
           
protected static java.lang.String getNameForAction(java.lang.String key)
          return the name for an action.
static javax.swing.AbstractButton localizeAbstractButton(javax.swing.AbstractButton ab, java.lang.String key, java.lang.String actionCommand)
          is called by the Actions, to localize themself.
static javax.swing.AbstractButton localizeAbstractButton(javax.swing.AbstractButton ab, java.lang.String key, java.lang.String actionCommand, boolean setText)
           
static void setupActions(AbstractDefaultAction[] as)
          tell me, what actions you have, and i tell you how to handle them...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
error logger


allActions

protected static java.util.HashMap allActions
all registered actions

Constructor Detail

ActionFactory

public ActionFactory()
Method Detail

setupActions

public static void setupActions(AbstractDefaultAction[] as)
tell me, what actions you have, and i tell you how to handle them...


localizeAbstractButton

public static javax.swing.AbstractButton localizeAbstractButton(javax.swing.AbstractButton ab,
                                                                java.lang.String key,
                                                                java.lang.String actionCommand)
is called by the Actions, to localize themself.


localizeAbstractButton

public static javax.swing.AbstractButton localizeAbstractButton(javax.swing.AbstractButton ab,
                                                                java.lang.String key,
                                                                java.lang.String actionCommand,
                                                                boolean setText)

getNameForAction

protected static java.lang.String getNameForAction(java.lang.String key)
return the name for an action. if it find a "Insert" at the beginning, it will discarded. Insert is something like a keyword, only use it if you know what your doing...


createMenuItems

protected static void createMenuItems(java.lang.String className,
                                      ActionFactory.MenuGenerator mg)
creates an the Menu wih help of a MenuGenerator this will look up to the resources file, extract the value for: actions.[className] and parse it and delegate the real action to the MenuGenerator-Instance


createMenu

public static javax.swing.JMenu createMenu(java.lang.Class o)
creates a JMenu structure for given Object. This will lookup the res file for a string action.[className of o] to parse it


createPopupMenu

public static javax.swing.JPopupMenu createPopupMenu(java.lang.Class o)
creates a JPopupMenu structure for given Object. This will lookup the res file for a string action.[className of o] to parse it


createToolBar

public static javax.swing.JToolBar createToolBar(java.lang.Class o)

createMenu

public static javax.swing.JMenu createMenu(java.lang.Object o)

createPopupMenu

public static javax.swing.JPopupMenu createPopupMenu(java.lang.Object o)

createToolBar

public static javax.swing.JToolBar createToolBar(java.lang.Object o)