Package jadex.base.gui.filetree
Class RootNode
- java.lang.Object
-
- jadex.base.gui.asynctree.AbstractTreeNode
-
- jadex.base.gui.asynctree.AbstractSwingTreeNode
-
- jadex.base.gui.filetree.RootNode
-
- All Implemented Interfaces:
ISwingTreeNode
,ITreeNode
public class RootNode extends AbstractSwingTreeNode
The root node.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List
children
The list of child nodes.protected ComponentProperties
propcomp
The properties component (if any).-
Fields inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNode
tree
-
Fields inherited from class jadex.base.gui.asynctree.AbstractTreeNode
childrenfuture, dirty, model, parent, recurse, searching
-
-
Constructor Summary
Constructors Constructor Description RootNode(AsyncSwingTreeModel model, javax.swing.JTree tree)
Create a new service container node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(ISwingTreeNode child)
Add a child node.byte[]
getIcon()
Get the icon as byte[] for a node.java.lang.Object
getId()
Get the id used for lookup.int
getIndex(ISwingTreeNode node)
Returns the index of node in the receivers children.java.lang.String[]
getPathEntries()
Get the path entries {path, display name}.javax.swing.JComponent
getPropertiesComponent()
Get or create a component displaying the node properties.javax.swing.Icon
getSwingIcon()
Get the icon for a node.java.lang.String
getTooltipText()
Get tooltip text.boolean
hasProperties()
True, if the node has properties that can be displayed.boolean
isLeaf()
Check if the node is a leaf.void
refresh(boolean recurse)
Refresh the node.void
removeAll()
Remove a path entry from the tree.void
removeChild(ISwingTreeNode child)
Remove a path entry from the tree.protected void
searchChildren()
Asynchronously search for children.void
setChildren(java.util.List newchildren)
Set the children.java.lang.String
toString()
Create a string representation.-
Methods inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNode
addChild, addChild, equals, expandChildren, getCachedChildren, getChild, getChildCount, getChildren, getIndexOfChild, getModel, getParent, getTree, removeChild
-
Methods inherited from class jadex.base.gui.asynctree.AbstractTreeNode
checkChildren, dispose, hashCode, removeAllChildren, setParent
-
-
-
-
Field Detail
-
children
protected java.util.List children
The list of child nodes.
-
propcomp
protected ComponentProperties propcomp
The properties component (if any).
-
-
Constructor Detail
-
RootNode
public RootNode(AsyncSwingTreeModel model, javax.swing.JTree tree)
Create a new service container node.
-
-
Method Detail
-
setChildren
public void setChildren(java.util.List newchildren)
Set the children.- Overrides:
setChildren
in classAbstractSwingTreeNode
-
getId
public java.lang.Object getId()
Get the id used for lookup.
-
getIcon
public byte[] getIcon()
Get the icon as byte[] for a node.- Specified by:
getIcon
in interfaceITreeNode
- Specified by:
getIcon
in classAbstractTreeNode
-
getSwingIcon
public javax.swing.Icon getSwingIcon()
Get the icon for a node.- Specified by:
getSwingIcon
in interfaceISwingTreeNode
- Specified by:
getSwingIcon
in classAbstractSwingTreeNode
-
refresh
public void refresh(boolean recurse)
Refresh the node.- Specified by:
refresh
in interfaceITreeNode
- Overrides:
refresh
in classAbstractSwingTreeNode
- Parameters:
recurse
- Recursively refresh subnodes, if true.
-
searchChildren
protected void searchChildren()
Asynchronously search for children. Should call setChildren() once children are found.- Specified by:
searchChildren
in classAbstractTreeNode
-
addChild
public void addChild(ISwingTreeNode child)
Add a child node.- Parameters:
child
- The child node.
-
removeChild
public void removeChild(ISwingTreeNode child)
Remove a path entry from the tree.- Parameters:
child
- The child node.
-
removeAll
public void removeAll()
Remove a path entry from the tree.
-
toString
public java.lang.String toString()
Create a string representation.- Overrides:
toString
in classjava.lang.Object
-
getTooltipText
public java.lang.String getTooltipText()
Get tooltip text.- Specified by:
getTooltipText
in interfaceITreeNode
- Specified by:
getTooltipText
in classAbstractTreeNode
-
hasProperties
public boolean hasProperties()
True, if the node has properties that can be displayed.- Specified by:
hasProperties
in interfaceITreeNode
- Overrides:
hasProperties
in classAbstractTreeNode
-
getPropertiesComponent
public javax.swing.JComponent getPropertiesComponent()
Get or create a component displaying the node properties. Only to be called if hasProperties() is true;- Specified by:
getPropertiesComponent
in interfaceISwingTreeNode
- Overrides:
getPropertiesComponent
in classAbstractSwingTreeNode
-
isLeaf
public boolean isLeaf()
Check if the node is a leaf.- Specified by:
isLeaf
in interfaceITreeNode
- Overrides:
isLeaf
in classAbstractSwingTreeNode
-
getIndex
public int getIndex(ISwingTreeNode node)
Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.- Parameters:
node
-- Returns:
- an int.
-
getPathEntries
public java.lang.String[] getPathEntries()
Get the path entries {path, display name}.
-
-