com.sas.console.plugins
Class AbstractNode

java.lang.Object
  |
  +--com.sas.console.plugins.AbstractNode
All Implemented Interfaces:
ConsoleChangeListener, NodeInterface,
Direct Known Subclasses:
DriveNode, RootNode,

public abstract class AbstractNode
extends Object
implements NodeInterface, com.sas.console.plugins.NodeExpansionInterface

The Plug-in's root node appearing in the navigation tree.


Field Summary
protected  MutableTreeNode m_parent
          The parent node of this node.
protected  PluginNavigationInterface m_plugin
          The plug-in that this node belongs to.
protected  String m_strName
          The name of the node.
protected  Object m_userObject
          Optional user object.
 
Constructor Summary
AbstractNode(PluginNavigationInterface plugin)
          Constructor.
AbstractNode(PluginNavigationInterface plugin, String strName)
          Constructor.
 
Method Summary
 Enumeration children()
          Gets the children of this node as an enumeration.
 void collapsed(TreeExpansionEvent event)
          Called after the tree node has collapsed.
 void consoleChange(ConsoleChangeEvent event)
          Processes ConsoleChangeEvents when the happen.
 void drop(Vector dropItems)
          Drops an item on this node
 void expanded(TreeExpansionEvent event)
          Called after the tree node has expanded.
 boolean getAllowsChildren()
          Tells whether or not this node allows sub nodes.
 TreeNode getChildAt(int index)
          Get the child node of this node at the given index.
 int getChildCount()
          Get the number of children that this node has.
abstract  List getContextMenuActions()
          Returns a list of context menu actions.
 CustomViewInterface getCustomView()
          Returns the custom/specific view of this node.
 Icon getIcon(int size)
          Returns the small icon to be used in the tree view.
 int getIndex(TreeNode treeNode)
          Returns the index of the passed in node.
abstract  TableModelInterface getListViewData()
          Returns a list of the data to be shown in a list view.
 Root getMetadataObject()
          Returns the primary metadata object associated with this node.
 String getName()
          Returns the name of the Node.
 TreeNode getParent()
          Returns the parent node.
 PluginNavigationInterface getPlugin()
          Returns the node's plugin.
 List getPropertyTabs()
          Returns the property tabs that can display a view of this node's properties.
 String getStatusLineText()
          Returns a string to display on the status line.
abstract  List getToolBarActions()
          Returns a list of tool bar actions.
 TreePath getTreePath()
          Returns the tree path of the Node.
 void insert(MutableTreeNode child, int index)
          Inserts a child node at this index.
 boolean isLeaf()
          Indicates whether or not this node has any children.
abstract  void refresh()
          Performs the refresh defined by the node.
 void remove(int index)
          Removes the node at this index.
 void remove(MutableTreeNode node)
          Removes the passed in node.
 void removeFromParent()
          Removes this node from its parent.
 void setName(String strName)
          Sets the name of the Node.
 void setParent(MutableTreeNode newParent)
          Sets this node's parent.
 void setUserObject(Object object)
          Resets the user object of the receiver to object.
 String toString()
          Returns a string which represents the name of the node.
 void willCollapse(TreeExpansionEvent event)
          Called before the tree node has collapsed.
 void willExpand(TreeExpansionEvent event)
          Called before the tree node is expanded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_plugin

protected PluginNavigationInterface m_plugin
The plug-in that this node belongs to.

m_strName

protected String m_strName
The name of the node.

m_parent

protected MutableTreeNode m_parent
The parent node of this node.

m_userObject

protected transient Object m_userObject
Optional user object.
Constructor Detail

AbstractNode

public AbstractNode(PluginNavigationInterface plugin,
                    String strName)
Constructor.
Parameters:
plugin - The plug-in that this node belongs to.
strName - The name of the node.

AbstractNode

public AbstractNode(PluginNavigationInterface plugin)
Constructor.
Parameters:
plugin - The plug-in that this node belongs to.
Method Detail

getPlugin

public PluginNavigationInterface getPlugin()
Returns the node's plugin.
Specified by:
getPlugin in interface NodeInterface
Returns:
The node's plugin.

getName

public String getName()
Returns the name of the Node.
Specified by:
getName in interface NodeInterface
Returns:
The node name that appears in the tree

setName

public void setName(String strName)
Sets the name of the Node.
Parameters:
strName - The node name.

toString

public String toString()
Returns a string which represents the name of the node.
Overrides:
toString in class Object
Returns:
The name of the node.

getAllowsChildren

public boolean getAllowsChildren()
Tells whether or not this node allows sub nodes. Always returns true. Extending classes should implement as needed. Implementing a javax.swing.tree.TreeNode method.
Specified by:
getAllowsChildren in interface TreeNode
Returns:
True for this node allowing children.

children

public Enumeration children()
Gets the children of this node as an enumeration. Implementing a javax.swing.tree.TreeNode method.
Specified by:
children in interface TreeNode
Returns:
An enumeration of the node's children.

isLeaf

public boolean isLeaf()
Indicates whether or not this node has any children. Implementing a javax.swing.tree.TreeNode method.
Specified by:
isLeaf in interface TreeNode
Returns:
True if this node is a leaf node.

getChildCount

public int getChildCount()
Get the number of children that this node has. The default value is 0. Implementing a javax.swing.tree.TreeNode method.
Specified by:
getChildCount in interface TreeNode
Returns:
The number of children in this node.

getChildAt

public TreeNode getChildAt(int index)
Get the child node of this node at the given index. Implementing a javax.swing.tree.TreeNode method.
Specified by:
getChildAt in interface TreeNode
Returns:
The child node at this index.

insert

public void insert(MutableTreeNode child,
                   int index)
Inserts a child node at this index.
Specified by:
insert in interface MutableTreeNode
Parameters:
child - The child node to be inserted.
index - The index of the inserted child node.

remove

public void remove(int index)
Removes the node at this index.
Specified by:
remove in interface MutableTreeNode
Parameters:
index - The index of the node to be removed.

remove

public void remove(MutableTreeNode node)
Removes the passed in node.
Specified by:
remove in interface MutableTreeNode
Parameters:
node - The node to remove.

removeFromParent

public void removeFromParent()
Removes this node from its parent.
Specified by:
removeFromParent in interface MutableTreeNode

setParent

public void setParent(MutableTreeNode newParent)
Sets this node's parent.
Specified by:
setParent in interface NodeInterface
Parameters:
newParent - The parent to this node.

setUserObject

public void setUserObject(Object object)
Resets the user object of the receiver to object.
Specified by:
setUserObject in interface MutableTreeNode
Parameters:
object - The Object that constitutes this node's user-specified data.

getContextMenuActions

public abstract List getContextMenuActions()
Returns a list of context menu actions.
Specified by:
getContextMenuActions in interface NodeInterface
Returns:
The list of context menu actions. These are items that implement javax.swing.Action.

getParent

public TreeNode getParent()
Returns the parent node. Must return a TreeNode because this method is actually implementing a javax.swing.tree.TreeNode method.
Specified by:
getParent in interface TreeNode
Returns:
The parent node.

getListViewData

public abstract TableModelInterface getListViewData()
Returns a list of the data to be shown in a list view.
Specified by:
getListViewData in interface NodeInterface
Returns:
The list of data.

getIndex

public int getIndex(TreeNode treeNode)
Returns the index of the passed in node. Implementing a javax.swing.tree.TreeNode method.
Specified by:
getIndex in interface TreeNode
Parameters:
treeNode - The tree node whose index is to be returned.
Returns:
The index of the tree node.

getCustomView

public CustomViewInterface getCustomView()
Returns the custom/specific view of this node.
Specified by:
getCustomView in interface NodeInterface
Returns:
The custom view in a panel.

getToolBarActions

public abstract List getToolBarActions()
Returns a list of tool bar actions. The list should contain only enabled actions.
Specified by:
getToolBarActions in interface NodeInterface
Returns:
The list of tool bar actions. These are items that implement javax.swing.Action.

getStatusLineText

public String getStatusLineText()
Returns a string to display on the status line. The console asks for this string when a node is selected in the tree. If the text returned is null, the number of objects in the table model will be displayed in the status line.
Specified by:
getStatusLineText in interface NodeInterface
Returns:
String to display on the status line

getPropertyTabs

public List getPropertyTabs()
Returns the property tabs that can display a view of this node's properties.
Specified by:
getPropertyTabs in interface NodeInterface
Returns:
A set of com.sas.workspace.WAPropertyTab objects that are displayed in the node's property dialog.

getTreePath

public TreePath getTreePath()
Returns the tree path of the Node.
Specified by:
getTreePath in interface NodeInterface
Returns:
Path in the tree of this node.

getMetadataObject

public Root getMetadataObject()
Returns the primary metadata object associated with this node. Some nodes may be associated with multiple metadata objects.
Specified by:
getMetadataObject in interface NodeInterface
Returns:
Metadata object for this node or null if there is no associated object.

refresh

public abstract void refresh()
Performs the refresh defined by the node. Usually this involves checking the original source of the data to see if anything has changed.
Specified by:
refresh in interface NodeInterface

getIcon

public Icon getIcon(int size)
Returns the small icon to be used in the tree view. If no icon is returned, the default icon of a file folder will be used.
Specified by:
getIcon in interface NodeInterface
Returns:
The node small icon

drop

public void drop(Vector dropItems)
Drops an item on this node
Specified by:
drop in interface NodeInterface
Parameters:
dropItems - Vector items to be dropped on this node

consoleChange

public void consoleChange(ConsoleChangeEvent event)
Processes ConsoleChangeEvents when the happen. All plugin root nodes need to implement this method for processing when their views change.
Specified by:
consoleChange in interface ConsoleChangeListener
Following copied from interface: com.sas.console.ConsoleChangeListener
Parameters:
Event - that occurred.

willExpand

public void willExpand(TreeExpansionEvent event)
                throws ExpandVetoException
Called before the tree node is expanded. Use this method to populate the node with any children.
Specified by:
willExpand in interface NodeExpansionInterface
Parameters:
event - the TreeExpansionEvent
Throws:
ExpandVetoException - can throw this exception to stop the node from expanding.

expanded

public void expanded(TreeExpansionEvent event)
Called after the tree node has expanded. Use this method to update the icon to show the node is expanded.
Specified by:
expanded in interface NodeExpansionInterface
Parameters:
event - the TreeExpansionEvent

willCollapse

public void willCollapse(TreeExpansionEvent event)
                  throws ExpandVetoException
Called before the tree node has collapsed.
Specified by:
willCollapse in interface NodeExpansionInterface
Parameters:
event - the TreeExpansionEvent
Throws:
ExpandVetoException - can throw this exception to stop the node from collapsing.

collapsed

public void collapsed(TreeExpansionEvent event)
Called after the tree node has collapsed. Use this method to update the icon to show the node is collapsed.
Specified by:
collapsed in interface NodeExpansionInterface
Parameters:
event - the TreeExpansionEvent




Copyright © 2001-2003 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 15:59:52