com.alveole.studio.web.managers
Class JspGenericViewManager

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

public class JspGenericViewManager
extends java.lang.Object
implements ViewManager

This class is a manager of basic JSP views.

Author:
sylvain

Field Summary
static java.lang.String viewID
          This view ID.
static java.lang.String xmlns
          XMLNS.
 
Constructor Summary
JspGenericViewManager()
           
 
Method Summary
 NodeView copyView(ProjectContext context, NodeView source, NodePackage nodePackage)
          Perform copy...
 void createView(ProjectContext context, NodePackage nodePackage)
          Create a view of type JSP.
 void deleteView(NodeView view)
          Delete a JSP view.
 void editView(NodeView view, boolean shortView)
          Open JSP view: either open simple properties (if short view), or open JSP target file.
<T> T
getAdapter(NodeView view, java.lang.Class<T> cls)
          Adapts this view to other interfaces.
 java.awt.Image getNodeShape(NodeView view)
          Gets this node's representation shape.
static boolean openAndCreateJsp(ProjectContext context, NodeView view)
          Open a new JSP wizard.
 void serialize(NodeView view, org.w3c.dom.Element specific)
          Save JSP view specific part.
 void unserialize(NodeView view, org.w3c.dom.Element specific)
          Load JSP view specifiv part.
 
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 view ID.

See Also:
Constant Field Values

xmlns

public static final java.lang.String xmlns
XMLNS.

See Also:
Constant Field Values
Constructor Detail

JspGenericViewManager

public JspGenericViewManager()
Method Detail

createView

public void createView(ProjectContext context,
                       NodePackage nodePackage)
Create a view of type JSP.

Specified by:
createView in interface ViewManager
Parameters:
context - The current context.
nodePackage - The target package.

copyView

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

Specified by:
copyView in interface ViewManager
Parameters:
context - The project context.
source - The node to copy.
nodePackage - The target package.
Returns:
a copy of JSP view.

deleteView

public void deleteView(NodeView view)
Delete a JSP view.

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

openAndCreateJsp

public static boolean openAndCreateJsp(ProjectContext context,
                                       NodeView view)
Open a new JSP wizard. Warning: this method uses an internal eclipse API. It may change in future releases.

Parameters:
context - The project context.
view - The JSP view.
Returns:
true on success.

editView

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

Specified by:
editView in interface ViewManager
Parameters:
view - the view to edit.
shortView - The view mode.

serialize

public void serialize(NodeView view,
                      org.w3c.dom.Element specific)
Save JSP view specific part.

Specified by:
serialize in interface ViewManager
Parameters:
view - The node.
specific - The target XML tag.

unserialize

public void unserialize(NodeView view,
                        org.w3c.dom.Element specific)
Load JSP view specifiv part.

Specified by:
unserialize in interface ViewManager
Parameters:
view - The instance to fill.
specific - The tag containing specific properties.

getAdapter

public <T> T getAdapter(NodeView view,
                        java.lang.Class<T> cls)
Adapts this view to other interfaces. Only UrlManager is adapted here.

Specified by:
getAdapter in interface ViewManager
Parameters:
view - The view to adapt.
cls - The target class.
Returns:
an instance of the class.

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.