org.objectweb.jac.aspects.gui.web
Class Tree

java.lang.Object
  extended byorg.objectweb.jac.aspects.gui.web.AbstractView
      extended byorg.objectweb.jac.aspects.gui.web.Tree
All Implemented Interfaces:
HTMLViewer, TreeListener, View, ViewIdentity

public class Tree
extends AbstractView
implements View, HTMLViewer, TreeListener

This class defines a Swing component tree view for objects that are related to a root object through relations or collections.

See Also:
GuiAC

Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
Tree(ViewFactory factory, DisplayContext context, String pathDef, boolean showRelations)
          Constructs a new tree view.
 
Method Summary
 void close(boolean validate)
          Close this view.
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
protected  void genNode(PrintWriter out, AbstractNode node, String curPath)
           
protected  boolean isExpanded(AbstractNode node)
           
 void onCollapseNode(String nodePath)
           
 void onExpandNode(String nodePath)
           
 void onSelectNode(String nodePath)
          Called when a node of the tree is selected by the user.
protected  AbstractNode pathToNode(String nodePath)
           
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
closeForm, equalsView, equalsView, eventURL, eventURL, genBody, genEventAndActionButton, genPage, genStyleSheets, getBaseURL, getCloseBorder, getContext, getDescription, getFactory, getId, getId, getLabel, getMessage, getOpenBorder, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, iconElement, iconElement, isClosed, isDescendantOf, isInForm, openForm, printAttributes, setAttribute, setColumn, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParameters, setParentView, setRow, setSize, setStyle, setStyleSheet, setTable, setType, setViewBorder, showButton, showFormButtons, showFormButtons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jac.aspects.gui.View
getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParentView, setSize, setStyle, setViewBorder
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity
equalsView, equalsView, getParameters, getType, setParameters, setType
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 

Constructor Detail

Tree

public Tree(ViewFactory factory,
            DisplayContext context,
            String pathDef,
            boolean showRelations)
Constructs a new tree view.

Parameters:
pathDef - designate root objects of the tree
showRelations - wether to build a node for relation items
Method Detail

close

public void close(boolean validate)
Description copied from interface: View
Close this view. This should be upcalled when the view is closed in order to free resources or close other dependant views.

Specified by:
close in interface View
Overrides:
close in class AbstractView

genHTML

public void genHTML(PrintWriter out)
Description copied from interface: HTMLViewer
Generate the HTML code for the editor.

Specified by:
genHTML in interface HTMLViewer
Parameters:
out - the writer where to write the HTML code.

isExpanded

protected boolean isExpanded(AbstractNode node)

genNode

protected void genNode(PrintWriter out,
                       AbstractNode node,
                       String curPath)

onSelectNode

public void onSelectNode(String nodePath)
Description copied from interface: TreeListener
Called when a node of the tree is selected by the user.

Specified by:
onSelectNode in interface TreeListener

onExpandNode

public void onExpandNode(String nodePath)
Specified by:
onExpandNode in interface TreeListener

onCollapseNode

public void onCollapseNode(String nodePath)
Specified by:
onCollapseNode in interface TreeListener

pathToNode

protected AbstractNode pathToNode(String nodePath)