ch.elca.el4j.services.gui.swing
Class ActionsContext

java.lang.Object
  extended by ch.elca.el4j.services.gui.swing.ActionsContext

public final class ActionsContext
extends Object

This class holds the Actions context, that enables to resolve the Swing Action given the action name. It basically consists of an (ordered) list of objects having @Action annotated methods.

Author:
Stefan Wismer (SWI)
File-location:
ActionsContext
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Method Summary
 void add(Object instanceWithActionMappings)
          Add an instances to search for annotated methods.
static ActionsContext create(Object... instancesWithActionMappings)
          Create an ActionsContext.
static ActionsContext extend(ActionsContext parentContext, Object... instancesWithActionMappings)
          Extend an ActionsContext.
static ActionsContext extendDefault(Object... instancesWithActionMappings)
          Extend the ActionsContext of GUIApplication.
 Action getAction(Object object, String actionName)
          Returns the action object for a specific object and action name.
 Action getAction(String actionName)
          Returns the first action object found for an action name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extend

public static ActionsContext extend(ActionsContext parentContext,
                                    Object... instancesWithActionMappings)
Extend an ActionsContext.

Parameters:
parentContext - the parent ActionsContext to extend.
instancesWithActionMappings - an array containing all instances to search for annotated methods
Returns:
the created ActionsContext

extendDefault

public static ActionsContext extendDefault(Object... instancesWithActionMappings)
Extend the ActionsContext of GUIApplication.

Parameters:
instancesWithActionMappings - an array containing all instances to search for annotated methods
Returns:
the created ActionsContext

create

public static ActionsContext create(Object... instancesWithActionMappings)
Create an ActionsContext.

Parameters:
instancesWithActionMappings - an array containing all instances to search for annotated methods
Returns:
the created ActionsContext

add

public void add(Object instanceWithActionMappings)
Add an instances to search for annotated methods.

Parameters:
instanceWithActionMappings - an instances to search for annotated methods

getAction

public Action getAction(String actionName)
Returns the first action object found for an action name. (Looks in the internal list of candidate objects.)

Parameters:
actionName - the action name as String
Returns:
the corresponding action object

getAction

public Action getAction(Object object,
                        String actionName)
Returns the action object for a specific object and action name.

Parameters:
object - the object containing actions
actionName - the action name as String
Returns:
the corresponding action object


Copyright © 2005-2011 ELCA. All Rights Reserved.