com.alveole.interfaces
Interface ViewManager

All Known Implementing Classes:
JspGenericViewManager, StaticFileGenericViewManager, Struts2GenericViewManager

public interface ViewManager

This interface defines a plugin that may be used to manage views. It is similar to ActionManager but it is used to manage views only. Views may be JSP files, static files, or any template file. They are used to display action results.

Author:
sylvain

Method Summary
 NodeView copyView(ProjectContext context, NodeView source, NodePackage nodePackage)
          Copies a view (do not open a user dialog to fill specific values).
 void createView(ProjectContext context, NodePackage nodePackage)
          Create a view (open a user dialog to fill specific values).
 void deleteView(NodeView view)
          Delete this view.
 void editView(NodeView view, boolean shortView)
          Edit this view (display a user dialog).
<T> T
getAdapter(NodeView view, java.lang.Class<T> cls)
          Get adapter for thid node.
 java.awt.Image getNodeShape(NodeView view)
          Get Image to be displayed for the given view.
 void serialize(NodeView view, org.w3c.dom.Element specific)
          Serialize this node's specific part.
 void unserialize(NodeView view, org.w3c.dom.Element specific)
          Unserialize this node.
 

Method Detail

createView

void createView(ProjectContext context,
                NodePackage nodePackage)
Create a view (open a user dialog to fill specific values).

Parameters:
context - The context.
nodePackage - The package in which the view is added.

copyView

NodeView copyView(ProjectContext context,
                  NodeView source,
                  NodePackage nodePackage)
Copies a view (do not open a user dialog to fill specific values).

Parameters:
context - The context.
source - The source view.
nodePackage - The target package.
Returns:
A copy of the source, or null.

editView

void editView(NodeView view,
              boolean shortView)
Edit this view (display a user dialog). If short view, a single panel should be displayed. If not, a new editor should be opened to the target underlying view (JSP file for example).

Parameters:
view - The view to be edited.
shortView - Specifies if the view was selected by singleClick or dblClick.

deleteView

void deleteView(NodeView view)
Delete this view.

Parameters:
view - The view to delete.

serialize

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

Parameters:
view - The view to be serialized (specific parts only).
specific - The DOM tag in which specific parts must be stored.

unserialize

void unserialize(NodeView view,
                 org.w3c.dom.Element specific)
Unserialize this node.

Parameters:
view - The view to be unserialized (specific parts only).
specific - The DOM tag in which specific parts are stored.

getAdapter

<T> T getAdapter(NodeView view,
                 java.lang.Class<T> cls)
Get adapter for thid node. An adapter is used to find specific features that can be obtained for this type of node. For example, UrlManager may be implemented to add ability to be called by URL.

Parameters:
view - The niew to be adapted.
cls - The class to be mapped to.
Returns:
The adapted object or null.

getNodeShape

java.awt.Image getNodeShape(NodeView view)
Get Image to be displayed for the given view.

Parameters:
view - A node view.
Returns:
its representation.