net.sf.doolin.gui.action.path.list
Class ParsedActionPathList

java.lang.Object
  extended by net.sf.doolin.gui.action.path.list.ParsedActionPathList
All Implemented Interfaces:
ActionPathList

public class ParsedActionPathList
extends Object
implements ActionPathList

This class defines a list of ActionPath from a list of encoded paths.

Each encoded path is a semi-colon-separated (;) list of tokens. Only the last token is significant and will be used to create the actual ActionPath type. The previous tokens are used to build the path stack.

For example, the "File;New;-" encoded path will create a SeparatorActionPath (-) with the path stack set to ["File";"New"].

The table below shows the different formats used by the last token (which identifies the actual ActionPath instance).

Format Type
-<ignored> (anything starting with a "-") SeparatorActionPath. The remaining text is ignored.
@<name> PlaceholderActionPath with the given name
$<name> SubActionPath whose actionPath is looked up in the application context by its name
<name>@<placeholder> ReplacementActionPath with the given placeholder and whose action is looked up in the application context by its name
<name> Simple GUIActionPath whose action is looked up in the application context by its name

Author:
Damien Coraboeuf

Constructor Summary
ParsedActionPathList()
           
 
Method Summary
 GUIAction getAction(String name)
          Finds a GUIAction by its name in the ApplicationContext.
 ActionPath getActionPath(String name)
          Finds an ActionPath by its name in the ApplicationContext .
 List<ActionPath> getPaths()
          Returns the list of ActionPath.
 void init()
          Parses all encoded paths to actual instances of ActionPath.
protected  ActionPath parse(String path)
          Parses an encoded path to an actual instance of ActionPath.
 void setPaths(List<String> paths)
          Sets the list of paths using their encoded form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsedActionPathList

public ParsedActionPathList()
Method Detail

getAction

public GUIAction getAction(String name)
Finds a GUIAction by its name in the ApplicationContext.

Parameters:
name - Action name
Returns:
GUIAction instance

getActionPath

public ActionPath getActionPath(String name)
Finds an ActionPath by its name in the ApplicationContext .

Parameters:
name - Action name
Returns:
ActionPath instance

getPaths

public List<ActionPath> getPaths()
Description copied from interface: ActionPathList
Returns the list of ActionPath.

Specified by:
getPaths in interface ActionPathList
Returns:
List of ActionPath.

init

@PostConstruct
public void init()
Parses all encoded paths to actual instances of ActionPath.


parse

protected ActionPath parse(String path)
Parses an encoded path to an actual instance of ActionPath.

Parameters:
path - Encoded path
Returns:
ActionPath instance

setPaths

public void setPaths(List<String> paths)
Sets the list of paths using their encoded form.

Parameters:
paths - List of encoded paths


Copyright © 2011. All Rights Reserved.