com.alveole.interfaces
Interface ActionManager

All Known Implementing Classes:
Struts2ActionActionManager

public interface ActionManager

This interface defines a plugin that may be used to manage actions. This interface is similar to LinkManager, but it manages action nodes instead of links. Action nodes, formerly named "action nodes" (see NodeAction) are nodes that perform some action on data action of a web application. In Struts, they are named Action classes. This plugin interface, (com.alveole.studio.actionmanager) is used to add some new node types to this web-app editor.

Author:
sylvain
See Also:
NodeAction

Method Summary
 NodeAction copyAction(ProjectContext context, NodeAction source, NodePackage np)
          Copy a action (do not open a user dialog to fill specific values).
 void createAction(ProjectContext context, NodePackage np)
          Create a action (open a user dialog to fill specific values).
 void deleteAction(NodeAction action)
          Delete this action.
 void editAction(NodeAction action, boolean shortView)
          Edit this action (display a user dialog).
<T> T
getAdapter(NodeAction action, java.lang.Class<T> target)
          Gets adapter for the given node.
 java.awt.Image getNodeShape(NodeAction action)
          Get action shape for display in graph.
 void serialize(NodeAction action, org.w3c.dom.Element specific)
          Serialize this node's specific part.
 void unserialize(NodeAction action, org.w3c.dom.Element specific)
          Unserialize this node.
 

Method Detail

createAction

void createAction(ProjectContext context,
                  NodePackage np)
Create a action (open a user dialog to fill specific values).

Parameters:
context - The project context.
np - The package in which this node must be added.

copyAction

NodeAction copyAction(ProjectContext context,
                      NodeAction source,
                      NodePackage np)
Copy a action (do not open a user dialog to fill specific values). This method is called when user clicks "paste" after he has selected and copied some nodes.

Parameters:
context - The current project.
source - The original node.
np - The target package in which copied node must be dropped.
Returns:
the copy or null if cannot be copied.

editAction

void editAction(NodeAction action,
                boolean shortView)
Edit this action (display a user dialog).

Parameters:
action - The node to be edited.
shortView - Specifies if the node was selected by single click or dbl-click.

deleteAction

void deleteAction(NodeAction action)
Delete this action.

Parameters:
action - The node to delete.

serialize

void serialize(NodeAction action,
               org.w3c.dom.Element specific)
Serialize this node's specific part.

Parameters:
action - The node to serialize (serialize only specific parts of this node).
specific - A DOM tag that is used to store all specific data.

unserialize

void unserialize(NodeAction action,
                 org.w3c.dom.Element specific)
Unserialize this node.

Parameters:
action - The action to fill with specific data.
specific - The DOM node that contains all specific stored properties.

getAdapter

<T> T getAdapter(NodeAction action,
                 java.lang.Class<T> target)
Gets adapter for the given node. This method is used to implement specific interfaces for actions. For example, it can be used to add UrlManager feature on a node type.

Parameters:
action - The node to be adapted.
target - A target class.
Returns:
The adapted object or null.

getNodeShape

java.awt.Image getNodeShape(NodeAction action)
Get action shape for display in graph.

Parameters:
action - The node action.
Returns:
The image to represent this action.