com.alveole.studio.web.managers
Class StaticFileGenericViewManager

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

public class StaticFileGenericViewManager
extends java.lang.Object
implements ViewManager

This class is a manager of basic static files views. Note: this module may also be used for accessing any relative URL resource.

Author:
sylvain

Field Summary
static java.lang.String viewID
          This plugin ID.
static java.lang.String xmlns
          This plugin xmlns.
 
Constructor Summary
StaticFileGenericViewManager()
           
 
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.
static boolean openFile(ProjectContext context, NodeView view)
          Open a new static file wizard.
 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

xmlns

public static final java.lang.String xmlns
This plugin xmlns.

See Also:
Constant Field Values
Constructor Detail

StaticFileGenericViewManager

public StaticFileGenericViewManager()
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.

openFile

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

Parameters:
context - The project context.
view - The static file view.

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.