com.sas.servlet.tbeans.models
Class Node

com.sas.servlet.tbeans.models.Node
All Implemented Interfaces:
NodeInterface, java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
MenuBarNode, SelectorMenuItemNode, SimpleMenuItemNode, TreeNode

public class Node
implements NodeInterface

Node is a generic implementation of NodeInterface. Node is a single unit in a hierarchical structure. It provides textual descriptions, children and user specified data.

See Also:
Serialized Form

Constructor Summary
Node()
          Constructs a Node object.
Node(java.lang.String nodeText)
          Constructs a Node object with the specified text.
Node(java.lang.String nodeText, java.lang.String nodeType)
          Constructs a Node object with the specified text and type.
 
Method Summary
 void addItems(java.util.Enumeration items)
          Appends the enumeration of SimpleNodeInterface objects to the children of the current node.
 int getIndex(javax.swing.tree.MutableTreeNode item, int startIndex)
          Returns the 0-based index associated with the NodeInterface object in the children collection (searches forward)
 java.lang.String getNodeExpandedText()
          Returns the value of the nodeExpandedText property.
 java.lang.String getNodeText()
          Returns the value of the nodeText property.
 java.lang.String getNodeType()
          Returns the type of the current node.
 java.lang.String[] getNodeTypes()
          Returns the complete set of types for a node.
 java.lang.Object getObjectData()
          Returns user-supplied data for the current node.
 boolean isExternalUpdateSupported()
          Returns the value of the externalUpdateSupported property.
 void setExternalUpdateSupported(boolean newValue)
          Sets the value of the externalUpdateSupported property.
 void setNodeExpandedText(java.lang.String newValue)
          Sets the expanded text of the current node.
 void setNodeText(java.lang.String newValue)
          Sets the text of the current node.
 void setNodeType(java.lang.String newValue)
          Sets the type of the current node.
 void setObjectData(java.lang.Object newValue)
          Sets the object data for the current node.
 java.lang.String toString()
          Returns the value of the nodeText property.
 

Constructor Detail

Node

public Node()
Constructs a Node object.


Node

public Node(java.lang.String nodeText)
Constructs a Node object with the specified text. The nodeText property will be initialized with the specified text string.

Parameters:
nodeText - the initial value for the nodeText property

Node

public Node(java.lang.String nodeText,
            java.lang.String nodeType)
Constructs a Node object with the specified text and type. The nodeText and nodeType properties will be initialized with the specified text and type strings.

Parameters:
nodeText - the initial value for the nodeText property
nodeType - the initial value for the nodeType property
Method Detail

getNodeExpandedText

public java.lang.String getNodeExpandedText()
Description copied from interface: NodeInterface
Returns the value of the nodeExpandedText property. The expanded text is usually a more descriptive version of the nodeText property. For example, a node that represents a file can return the file name for the nodeText property and the full path name for the nodeExpandedText property.

Specified by:
getNodeExpandedText in interface NodeInterface
Returns:
the nodeExpandedText property

getNodeType

public java.lang.String getNodeType()
Description copied from interface: NodeInterface
Returns the type of the current node. The type is a text string which allows the user of a node hierarchy to add more information to nodes. For example nodes in a file system viewer could use "file" or "directory" as the type to distinguish between nodes representing files and directories.

Specified by:
getNodeType in interface NodeInterface
Returns:
the type of the current node

getNodeText

public java.lang.String getNodeText()
Description copied from interface: NodeInterface
Returns the value of the nodeText property.

Specified by:
getNodeText in interface NodeInterface
Returns:
the nodeText property

isExternalUpdateSupported

public boolean isExternalUpdateSupported()
Returns the value of the externalUpdateSupported property.

Returns:
true to allow external updates, false otherwise
See Also:
setExternalUpdateSupported(boolean)

getNodeTypes

public java.lang.String[] getNodeTypes()
Returns the complete set of types for a node. NOTE: This property is not currently used.

Returns:
null, or a string array of all the possible node types.

addItems

public void addItems(java.util.Enumeration items)
Appends the enumeration of SimpleNodeInterface objects to the children of the current node.

Parameters:
items - the SimpleNodeInterface objects to add as children

getIndex

public int getIndex(javax.swing.tree.MutableTreeNode item,
                    int startIndex)
Returns the 0-based index associated with the NodeInterface object in the children collection (searches forward)

Parameters:
item - NodeInterface to search for
startIndex - the position where the search should start
Returns:
int the 0-based index corresponding to the NodeInterface object or -1 if the item is not found.
Throws:
java.lang.IndexOutOfBoundsException - if the start index is invalid

getObjectData

public java.lang.Object getObjectData()
Returns user-supplied data for the current node.

Returns:
user data for this node
See Also:
setObjectData(java.lang.Object)

setExternalUpdateSupported

public void setExternalUpdateSupported(boolean newValue)
Sets the value of the externalUpdateSupported property.

Parameters:
newValue - true to allow external updates, false otherwise
See Also:
isExternalUpdateSupported()

setNodeExpandedText

public void setNodeExpandedText(java.lang.String newValue)
Sets the expanded text of the current node.

Parameters:
newValue - the new value for the nodeExpandedText property
See Also:
getNodeExpandedText()

setNodeType

public void setNodeType(java.lang.String newValue)
Sets the type of the current node. The type can be used for categorizing nodes.

Parameters:
newValue - the new value for the nodeType property
See Also:
getNodeType()

setNodeText

public void setNodeText(java.lang.String newValue)
Sets the text of the current node.

Parameters:
newValue - the new value for the nodeText property
See Also:
getNodeText()

setObjectData

public void setObjectData(java.lang.Object newValue)
Sets the object data for the current node.

Parameters:
newValue - the new value for the objectData property
See Also:
getObjectData()

toString

public java.lang.String toString()
Returns the value of the nodeText property.

Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
the value of the nodeText property



Copyright © 2009 SAS Institute Inc. All Rights Reserved.