| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sri.emo.controller.TreeViewVisitor
public class TreeViewVisitor
TreeView Visitor transforms the model tree into a unified hiearchial tree that TreeMenuTag can understand for rendering a javascript tree.
Design-wise, it is useful because it separates all the view from the model: the tree model knows nothing about stylesheets, current URLs, etc
This visitor is slightly different from the GoF pattern in that it is
 reponsible for traversing the data structure and maintaining its own
 state while traversing, although for clarification, the ModelNode
 provides an Iterator that is used.
| Field Summary | |
|---|---|
(package private) static String | 
EMPTY_NODE_CLOSED
CSS Style: un-completed node de-selected.  | 
(package private) static String | 
EMPTY_NODE_OPEN
CSS Style: un-completed node selected.  | 
(package private) static String | 
EMPTY_SLOT_SELECTED
CSS Style: multiple attribute not filled out selected.  | 
(package private) static String | 
EMPTY_SLOT_UNSELECTED
CSS Style: multiple attribute not filled out unselected.  | 
(package private) static String | 
FILLED_NODE_CLOSED
CSS Style: Completed Node de-selected.  | 
(package private) static String | 
FILLED_NODE_OPEN
CSS Style: Completed Node selected.  | 
(package private) static String | 
FILLED_SLOT_CLOSED
CSS Style: multiple attribute completed unselected.  | 
(package private) static String | 
FILLED_SLOT_SELECTED
CSS Style: multiple attribute completed selected.  | 
(package private) static String | 
PARTIAL_NODE_CLOSED
CSS Style: Partially-completed node de-selected.  | 
(package private) static String | 
PARTIAL_NODE_OPEN
CSS Style: Partially-completed node selected.  | 
(package private) static String | 
PARTIAL_SLOT_CLOSED
CSS Style: multiple attribute partially filled unselected.  | 
(package private) static String | 
PARTIAL_SLOT_OPEN
CSS Style: multiple attribute partially filled selected.  | 
(package private) static String | 
SINGLE_SELECTED
CSS Style: single attribute selected.  | 
(package private) static String | 
SINGLE_UNSELECTED
CSS Style: single attribute unselected.  | 
(package private) static String | 
TRUNCATED_STYLE
CSS Style: Truncated nodes  | 
(package private)  DefaultTreeNode | 
viewRoot
The root of the 'view tree' we're building.  | 
| Fields inherited from interface com.sri.emo.dbobj.model_tree.TreeTraversalListener | 
|---|
NULL_LISTENER | 
| Constructor Summary | |
|---|---|
TreeViewVisitor(ExpressoResponse response)
Default constructor.  | 
|
| Method Summary | |
|---|---|
 void | 
ascendModelTree(ModelNode newCurrentNode)
Registers a pop back up the tree.  | 
 void | 
descendModelTree(ModelNode newCurrentNode)
Registers descending through the tree.  | 
 ExpressoResponse | 
getControllerResponse()
 | 
 ModelNode | 
getCurrentModelNode()
 | 
 TreeNode | 
getTree()
Retrieve the tree that is suitable for viewing.that has been built.  | 
 void | 
setCurrentModelNode(ModelNode nextModelNode)
 | 
 TreeNode | 
traverseModelTree(Model modelToTraverse)
Traverse the model tree.  | 
 void | 
visitAttribute(Attribute dataAttribute)
Visits an attribute.  | 
 void | 
visitNode(Node dataNode)
Visits a Node.  | 
 void | 
visitNodeType(NodeType nodeType)
Visits a node type.  | 
 void | 
visitPart(Part part)
Populates the view with a Part (or Slot)  | 
 void | 
visitPickList(PickList picklist)
Visits a picklist.  | 
 void | 
visitRelation(Relation relation)
Visits a Relation  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
static final String FILLED_NODE_OPEN
static final String FILLED_NODE_CLOSED
static final String PARTIAL_NODE_OPEN
static final String PARTIAL_NODE_CLOSED
static final String EMPTY_NODE_OPEN
static final String EMPTY_NODE_CLOSED
static final String SINGLE_SELECTED
static final String SINGLE_UNSELECTED
static final String FILLED_SLOT_SELECTED
static final String FILLED_SLOT_CLOSED
static final String EMPTY_SLOT_SELECTED
static final String EMPTY_SLOT_UNSELECTED
static final String PARTIAL_SLOT_OPEN
static final String PARTIAL_SLOT_CLOSED
static final String TRUNCATED_STYLE
DefaultTreeNode viewRoot
| Constructor Detail | 
|---|
public TreeViewVisitor(ExpressoResponse response)
response - The ControllerResponse object for use
                 in building Transitions.| Method Detail | 
|---|
public TreeNode getTree()
public void visitAttribute(Attribute dataAttribute)
visitAttribute in interface ModelVisitordataAttribute - Attributepublic void visitNode(Node dataNode)
visitNode in interface ModelVisitordataNode - Nodepublic void visitNodeType(NodeType nodeType)
visitNodeType in interface ModelVisitornodeType - NodeType
ViewVisitorException - upon error.public void visitPart(Part part)
visitPart in interface ModelVisitorpart - Part
ViewVisitorException - upon error.public void visitPickList(PickList picklist)
visitPickList in interface ModelVisitorpicklist - PickListpublic void visitRelation(Relation relation)
ModelVisitor
visitRelation in interface ModelVisitorrelation - Relation
ViewVisitorException - upon error.public TreeNode traverseModelTree(Model modelToTraverse)
modelToTraverse - Model
public void descendModelTree(ModelNode newCurrentNode)
descendModelTree in interface TreeTraversalListenernewCurrentNode - the new current node in the model that the iterator
                       has descended to.public void ascendModelTree(ModelNode newCurrentNode)
ascendModelTree in interface TreeTraversalListenernewCurrentNode - the new current model node that the iterator
                       as popped up to.public ModelNode getCurrentModelNode()
public void setCurrentModelNode(ModelNode nextModelNode)
public ExpressoResponse getControllerResponse()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||