Class ResourceNode

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

public abstract class ResourceNode extends DefaultMutableTreeNode implements TreeWillExpandListener
JTree node for representing database content (raw files / documents).
Author:
BaseX Team 2005-21, BSD License, Lukas Kircher
See Also:
  • Field Details

    • name

      public final byte[] name
      Node name.
  • Method Details

    • preparePath

      public static byte[] preparePath(byte[] path)
      Prepares the given path to be used as a tree node. The returned path looks the following:
      1. The path is relative to the database root directory
      2. It has one leading slash
      3. It has no trailing slashes, no matter if it represents a folder or file
      Parameters:
      path - path to be prepared
      Returns:
      path
    • path

      public final String path()
      Returns the complete path (path + name) of this node as a string.
      Returns:
      path string
    • treeWillExpand

      public void treeWillExpand(TreeExpansionEvent e)
      Specified by:
      treeWillExpand in interface TreeWillExpandListener
    • treeWillCollapse

      public void treeWillCollapse(TreeExpansionEvent e)
      Specified by:
      treeWillCollapse in interface TreeWillExpandListener
    • toString

      public String toString()
      Overrides:
      toString in class DefaultMutableTreeNode