Class ResourceFolder

All Implemented Interfaces:
Serializable, Cloneable, EventListener, TreeWillExpandListener, MutableTreeNode, TreeNode
Direct Known Subclasses:
ResourceRootFolder

public class ResourceFolder extends ResourceNode
JTree node which represents a folder.
Author:
BaseX Team 2005-21, BSD License, Lukas Kircher
See Also:
  • Field Details

    • MAXC

      public static final int MAXC
      Maximum number of displayed/processed children for a node.
      See Also:
  • Constructor Details

    • ResourceFolder

      public ResourceFolder(byte[] name, byte[] path, BaseXTree tree, Context context)
      Constructor.
      Parameters:
      name - displayed node name
      path - folder path
      tree - tree reference
      context - database context
  • Method Details

    • addLeaves

      public final int addLeaves(byte[] filter, int cmax, ResourceFolder 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 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:
      isLeaf in interface TreeNode
      Overrides:
      isLeaf in class DefaultMutableTreeNode