org.basex.gui.layout
Class TreeFolder

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.basex.gui.layout.TreeNode
          extended by org.basex.gui.layout.TreeFolder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.TreeWillExpandListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
TreeRootFolder

public class TreeFolder
extends TreeNode

JTree node which represents a folder.

Author:
BaseX Team 2005-12, BSD License, Lukas Kircher
See Also:
Serialized Form

Field Summary
static int MAXC
          Maximum number of displayed/processed children for a node.
 
Fields inherited from class org.basex.gui.layout.TreeNode
name
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TreeFolder(byte[] nm, byte[] pth, BaseXTree t, Data d)
          Constructor.
 
Method Summary
 int addLeaves(byte[] filter, int cmax, TreeFolder target)
          Filters child nodes by the given filter expression and adds the remaining children to the given node.
 boolean isLeaf()
           
static byte[] name(byte[] path)
          Extracts the file/document/folder name from the given path.
static byte[] path(byte[] path)
          Returns the path without folder/file name for the given path.
 void reload()
          Reloads this node without repainting the tree.
 void removeChildren()
          Removes all children from this node.
 
Methods inherited from class org.basex.gui.layout.TreeNode
path, preparePath, toString, treeWillCollapse, treeWillExpand
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAXC

public static final int MAXC
Maximum number of displayed/processed children for a node.

See Also:
Constant Field Values
Constructor Detail

TreeFolder

public TreeFolder(byte[] nm,
                  byte[] pth,
                  BaseXTree t,
                  Data d)
Constructor.

Parameters:
nm - displayed node name
pth - folder path
t - tree reference
d - data reference
Method Detail

addLeaves

public int addLeaves(byte[] filter,
                     int cmax,
                     TreeFolder target)
Filters child nodes by the given filter expression and adds the remaining children to the given node.

Parameters:
filter - filter expression
cmax - counter for the maximum number of children to add
target - node to append filtered nodes
Returns:
number of remaining nodes that can be added

name

public static byte[] name(byte[] path)
Extracts the file/document/folder name from the given path.

Parameters:
path - path
Returns:
name

path

public static byte[] path(byte[] path)
Returns the path without folder/file name for the given path.

Parameters:
path - path
Returns:
path without file/folder name

removeChildren

public void removeChildren()
Removes all children from this node.


reload

public void reload()
Reloads this node without repainting the tree.


isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode