org.mockcentral.editor.nodes
Class MockCentralNode

java.lang.Object
  extended by org.mockcentral.editor.nodes.MockCentralNode
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>
Direct Known Subclasses:
ExpectationGroupNode, ExpectationNode, FixtureGroupNode, FixtureNode, MockObjectGroupNode, MockObjectNode, RootNode

public abstract class MockCentralNode
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

Base for the classes which store the JDOM Element instances that are used to construct the domain model. These classes also function as the input for the IMockCentralEditorOutline display, allowing the user to select distinct parts of the model for viewing and editing. The SetElement method is used to assign the Element, set up the display value for the associated tree item and to construct any necessary child instances from data stored in the Element.

Author:
David Hutchinson

Field Summary
protected  java.util.List<MockCentralNode> children
          A list of all the MockCentralNode children of this node.
protected  boolean deleted
          Value for whether the node has been deleted.
protected  org.jdom.Element element
          The JDOM Element associated with this node.
protected  java.lang.String nodeDescription
          A String describing this node.
protected  MockCentralNodeModel nodeModel
          The MockCentralNodeModel modeling the jdom Element data.
protected  NodeProblemManager nodeProblemManager
          The NodeProblemManager used to manage any NodeProblem objects associated with this node.
protected  IMockCentralNodeView nodeView
          The IMockCentralNodeView used for displaying and editing the modeled data.
protected  MockCentralNode parentNode
          This node's parent MockCentralNode.
 
Constructor Summary
MockCentralNode()
           
 
Method Summary
 void activateChildNode(java.lang.String childName)
          Activates the child child MockCentralTreeNode identified by the parameter.
abstract  void createNodeDescription()
          Creates the node description value.
 MockCentralNode getChildNodeOfName(java.lang.String childName)
          Returns the child MockCentralNode from the list of children that has the name (toString() value) matching the parameter.
 java.util.List<MockCentralNode> getChildren()
          Returns the list of MockCentralNode children.
 org.jdom.Element getElement()
          Returns the element for this node.
abstract  MockCentralNodeType getMockCentralNodeType()
          Returns the MockCentralNodeType value identifying the type for this node.
 java.lang.String getNodeDescription()
          Returns a description for this instance.
 MockCentralNodeModel getNodeModel()
          Returns the MockCentralNodeModel modeling the node data.
 NodeProblemManager getNodeProblemManager()
          Returns the NodeProblemManager used to manage any NodeProblem objects associated with this node.
 IMockCentralNodeView getNodeView()
          Returns the IMockCentralNodeView used for displaying and editing the node data.
 MockCentralNode getParentNode()
          Returns the parent MockCentralNode.
 java.lang.String getPath()
          Returns a String representing the path to this node within the node hierarchy.
 void initializeComponents()
          Initializes the MVC components associated with this node.
 boolean isDeleted()
          Returns the flag for whether this instance has been deleted.
 void setDeleted(boolean deleted)
          Sets the flag for whether this instance has been deleted.
 void setElement(org.jdom.Element element)
          Sets the jdom Element represented by this node, invokes the createNodeDescription method to create the toString value and iterates through the content of the Element to create the list of child nodes.
 void setParentNode(MockCentralNode parentNode)
          Sets the parent MockCentralNode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

element

protected org.jdom.Element element
The JDOM Element associated with this node.


nodeDescription

protected java.lang.String nodeDescription
A String describing this node.


nodeProblemManager

protected NodeProblemManager nodeProblemManager
The NodeProblemManager used to manage any NodeProblem objects associated with this node.


nodeModel

protected MockCentralNodeModel nodeModel
The MockCentralNodeModel modeling the jdom Element data.


nodeView

protected IMockCentralNodeView nodeView
The IMockCentralNodeView used for displaying and editing the modeled data.


parentNode

protected MockCentralNode parentNode
This node's parent MockCentralNode.


children

protected java.util.List<MockCentralNode> children
A list of all the MockCentralNode children of this node.


deleted

protected boolean deleted
Value for whether the node has been deleted.

Constructor Detail

MockCentralNode

public MockCentralNode()
Method Detail

getNodeDescription

public java.lang.String getNodeDescription()
Returns a description for this instance.

Returns:
a description for this instance.

getMockCentralNodeType

public abstract MockCentralNodeType getMockCentralNodeType()
Returns the MockCentralNodeType value identifying the type for this node.

Returns:
the MockCentralNodeType value identifying the type for this node.

createNodeDescription

public abstract void createNodeDescription()
Creates the node description value.


setElement

public void setElement(org.jdom.Element element)
Sets the jdom Element represented by this node, invokes the createNodeDescription method to create the toString value and iterates through the content of the Element to create the list of child nodes.

Parameters:
element - the jdom element represented by this node.

getElement

public org.jdom.Element getElement()
Returns the element for this node.

Returns:
the element for this node.

setParentNode

public void setParentNode(MockCentralNode parentNode)
Sets the parent MockCentralNode.

Parameters:
parentNode - the parent MockCentralNode.

getParentNode

public MockCentralNode getParentNode()
Returns the parent MockCentralNode.

Returns:
the parent MockCentralNode.

getChildren

public java.util.List<MockCentralNode> getChildren()
Returns the list of MockCentralNode children.

Returns:
the list of MockCentralNode children.

getChildNodeOfName

public MockCentralNode getChildNodeOfName(java.lang.String childName)
Returns the child MockCentralNode from the list of children that has the name (toString() value) matching the parameter.

Parameters:
childName - the name (toString() value) of the child MockCentralNode to return.
Returns:
a child MockCentralNode from the list of children.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

initializeComponents

public void initializeComponents()
Initializes the MVC components associated with this node.


getNodeModel

public MockCentralNodeModel getNodeModel()
Returns the MockCentralNodeModel modeling the node data.

Returns:
the MockCentralNodeModel modeling the node data.

getNodeView

public IMockCentralNodeView getNodeView()
Returns the IMockCentralNodeView used for displaying and editing the node data.

Returns:
the IMockCentralNodeView used for displaying and editing the node data.

activateChildNode

public void activateChildNode(java.lang.String childName)
Activates the child child MockCentralTreeNode identified by the parameter.

Parameters:
childName - the name of the child MockCentralNode.

setDeleted

public void setDeleted(boolean deleted)
Sets the flag for whether this instance has been deleted.

Parameters:
deleted - whether this instance has been deleted.

isDeleted

public boolean isDeleted()
Returns the flag for whether this instance has been deleted.

Returns:
the flag for whether this instance has been deleted.

getPath

public java.lang.String getPath()
Returns a String representing the path to this node within the node hierarchy.

Returns:
a String representing the path to this node within the node hierarchy.

getNodeProblemManager

public NodeProblemManager getNodeProblemManager()
Returns the NodeProblemManager used to manage any NodeProblem objects associated with this node.

Returns:
the NodeProblemManager used to manage any NodeProblem objects associated with this node.