com.alveole.studio.web.managers
Class Struts2GenericViewManager

java.lang.Object
  extended by com.alveole.studio.web.managers.Struts2GenericViewManager
All Implemented Interfaces:
ViewManager

public class Struts2GenericViewManager
extends java.lang.Object
implements ViewManager

This class is a manager of struts2 views. It enables to specify any result value for actions.

Author:
sylvain

Field Summary
static java.lang.String viewID
          This plugin ID.
 
Constructor Summary
Struts2GenericViewManager()
           
 
Method Summary
 NodeView copyView(ProjectContext context, NodeView source, NodePackage nodePackage)
          Perform deep copy...
 void createView(ProjectContext context, NodePackage nodePackage)
          Create a view for a static file target.
 void deleteView(NodeView view)
          Delete a static file view.
 void editView(NodeView view, boolean shortView)
          Open view: either open simple properties (if short view), or open target file.
<T> T
getAdapter(NodeView view, java.lang.Class<T> cls)
          Get any implemented interface for this type of view.
 java.awt.Image getNodeShape(NodeView view)
          Gets this node's representation shape.
 void serialize(NodeView view, org.w3c.dom.Element specific)
          Serialize this element.
 void unserialize(NodeView view, org.w3c.dom.Element specific)
          Unserialise this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewID

public static final java.lang.String viewID
This plugin ID.

See Also:
Constant Field Values
Constructor Detail

Struts2GenericViewManager

public Struts2GenericViewManager()
Method Detail

createView

public void createView(ProjectContext context,
                       NodePackage nodePackage)
Create a view for a static file target.

Specified by:
createView in interface ViewManager
Parameters:
context - The context.
nodePackage - The package in which the view is added.

copyView

public NodeView copyView(ProjectContext context,
                         NodeView source,
                         NodePackage nodePackage)
Perform deep copy...

Specified by:
copyView in interface ViewManager
Parameters:
context - The context.
source - The source view.
nodePackage - The target package.
Returns:
A copy of the source, or null.

deleteView

public void deleteView(NodeView view)
Delete a static file view.

Specified by:
deleteView in interface ViewManager
Parameters:
view - The view to delete.

editView

public void editView(NodeView view,
                     boolean shortView)
Open view: either open simple properties (if short view), or open target file. If target file does not exist, create it.

Specified by:
editView in interface ViewManager
Parameters:
view - The view to be edited.
shortView - Specifies if the view was selected by singleClick or dblClick.

serialize

public void serialize(NodeView view,
                      org.w3c.dom.Element specific)
Serialize this element.

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

unserialize

public void unserialize(NodeView view,
                        org.w3c.dom.Element specific)
Unserialise this element.

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

getAdapter

public <T> T getAdapter(NodeView view,
                        java.lang.Class<T> cls)
Get any implemented interface for this type of view.

Specified by:
getAdapter in interface ViewManager
Parameters:
view - The niew to be adapted.
cls - The class to be mapped to.
Returns:
The adapted object or null.

getNodeShape

public java.awt.Image getNodeShape(NodeView view)
Gets this node's representation shape.

Specified by:
getNodeShape in interface ViewManager
Parameters:
view - A node view.
Returns:
its representation.