Class JavaScriptTreeNode

All Implemented Interfaces:
Serializable, Cloneable, Comparable<SourceTreeNode>, MutableTreeNode, TreeNode

public class JavaScriptTreeNode extends SourceTreeNode
Tree node for JavaScript outline trees.
Version:
1.0
See Also:
  • Field Details

    • pos

      private Position pos
      The location of this source element in the document.
    • text

      private String text
      The text to display in the tree.
    • icon

      private Icon icon
      The icon this node displays in the tree.
  • Constructor Details

    • JavaScriptTreeNode

      public JavaScriptTreeNode(List<org.mozilla.javascript.ast.AstNode> userObject)
    • JavaScriptTreeNode

      public JavaScriptTreeNode(org.mozilla.javascript.ast.AstNode userObject)
    • JavaScriptTreeNode

      public JavaScriptTreeNode(org.mozilla.javascript.ast.AstNode userObject, boolean sorted)
  • Method Details

    • getIcon

      public Icon getIcon()
    • getLength

      public int getLength()
      Returns the length in the document of this source element.
      Returns:
      The length of this element.
      See Also:
    • getOffset

      public int getOffset()
      Returns the offset into the document of this source element. This offset tracks modifications in the document and has been updated accordingly.
      Returns:
      The offset.
      See Also:
    • getText

      public String getText(boolean selected)
    • setIcon

      public void setIcon(Icon icon)
    • setOffset

      public void setOffset(Position offs)
      Sets the absolute offset of this element in the document.
      Parameters:
      offs - The offset.
      See Also:
    • setText

      public void setText(String text)
      Sets the text to display in the tree for this node.
      Parameters:
      text - The text to display.
    • toString

      public String toString()
      Overridden to return the textual representation displayed in the tree view.
      Overrides:
      toString in class DefaultMutableTreeNode
      Returns:
      The text of this tree node.