Package org.basex.gui.layout
Class ResourceFolder
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
org.basex.gui.layout.ResourceNode
org.basex.gui.layout.ResourceFolder
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,TreeWillExpandListener,MutableTreeNode,TreeNode
- Direct Known Subclasses:
ResourceRootFolder
JTree node which represents a folder.
- Author:
- BaseX Team 2005-21, BSD License, Lukas Kircher
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of displayed/processed children for a node.Fields inherited from class org.basex.gui.layout.ResourceNode
nameFields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject -
Constructor Summary
ConstructorsConstructorDescriptionResourceFolder(byte[] name, byte[] path, BaseXTree tree, Context context) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal intaddLeaves(byte[] filter, int cmax, ResourceFolder target) Filters child nodes by the given filter expression and adds the remaining children to the given node.booleanisLeaf()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.final voidreload()Reloads this node without repainting the tree.final voidRemoves all children from this node.Methods inherited from class org.basex.gui.layout.ResourceNode
path, preparePath, toString, treeWillCollapse, treeWillExpandMethods 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
-
Field Details
-
MAXC
public static final int MAXCMaximum number of displayed/processed children for a node.- See Also:
-
-
Constructor Details
-
ResourceFolder
Constructor.- Parameters:
name- displayed node namepath- folder pathtree- tree referencecontext- database context
-
-
Method Details
-
addLeaves
Filters child nodes by the given filter expression and adds the remaining children to the given node.- Parameters:
filter- filter expressioncmax- counter for the maximum number of children to addtarget- 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 final void removeChildren()Removes all children from this node. -
reload
public final void reload()Reloads this node without repainting the tree. -
isLeaf
public boolean isLeaf()- Specified by:
isLeafin interfaceTreeNode- Overrides:
isLeafin classDefaultMutableTreeNode
-