com.alveole.studio.web.data
Class LinksManager

java.lang.Object
  extended by com.alveole.studio.web.data.LinksManager
All Implemented Interfaces:
LinkManager

public class LinksManager
extends java.lang.Object
implements LinkManager

This class is a default toolkit for managing links. This manager loads all plugins and is the main entry point for all plugins "LinkManager".

Author:
sylvain

Constructor Summary
LinksManager()
           
 
Method Summary
 boolean canLink(ProjectContext context, NodeContainer node1, NodeContainer node2)
          Check if a manager exists that can link these two nodes.
 NodeLink copyLink(ProjectContext context, NodeLink original, NodeContainer node1, NodeContainer node2)
          Perform a copy of a link.
 void createLink(ProjectContext context, NodeContainer node1, NodeContainer node2)
          Create a link.
 void deleteLink(ProjectContext context, NodeLink link)
          Delete a link.
 void editLink(ProjectContext context, NodeLink link, boolean shortView)
          Edit a link.
 void serialize(NodeLink link, org.w3c.dom.Element element)
          Never called.
 void unserialize(NodeLink nl, org.w3c.dom.Element element)
          Never called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinksManager

public LinksManager()
Method Detail

canLink

public boolean canLink(ProjectContext context,
                       NodeContainer node1,
                       NodeContainer node2)
Check if a manager exists that can link these two nodes.

Specified by:
canLink in interface LinkManager
Parameters:
context - Teh current project context.
node1 - The origin node.
node2 - The target node.
Returns:
True if link can be performed.

createLink

public void createLink(ProjectContext context,
                       NodeContainer node1,
                       NodeContainer node2)
Create a link. Call the underlying plugin.

Specified by:
createLink in interface LinkManager
Parameters:
context - The project context.
node1 - The origin node.
node2 - The target node.

deleteLink

public void deleteLink(ProjectContext context,
                       NodeLink link)
Delete a link.

Specified by:
deleteLink in interface LinkManager
Parameters:
context - The project context.
link - The link to be deleted.
See Also:
Project

editLink

public void editLink(ProjectContext context,
                     NodeLink link,
                     boolean shortView)
Edit a link.

Specified by:
editLink in interface LinkManager
Parameters:
context - The project context.
link - The link to be edited.
shortView - specifies if the edition mode is a single click (short view) or dble-click (open precise editor).

copyLink

public NodeLink copyLink(ProjectContext context,
                         NodeLink original,
                         NodeContainer node1,
                         NodeContainer node2)
Perform a copy of a link.

Specified by:
copyLink in interface LinkManager
Parameters:
context - The target project context.
original - The original link.
node1 - The copy of origin node.
node2 - The copy of target node.
Returns:
The copied link or null.

unserialize

public void unserialize(NodeLink nl,
                        org.w3c.dom.Element element)
Never called.

Specified by:
unserialize in interface LinkManager
Parameters:
nl - The node link.
element - The DOM element in which specific properties from link should be stored.

serialize

public void serialize(NodeLink link,
                      org.w3c.dom.Element element)
Never called.

Specified by:
serialize in interface LinkManager
Parameters:
link - The link to customize given the serialized data.
element - The specific DOM element that stores properties.