Class JavaScriptTreeNode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<SourceTreeNode>, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

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

      Fields 
      Modifier and Type Field Description
      private javax.swing.Icon icon
      The icon this node displays in the tree.
      private javax.swing.text.Position pos
      The location of this source element in the document.
      private java.lang.String text
      The text to display in the tree.
      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

        allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaScriptTreeNode​(java.util.List<org.mozilla.javascript.ast.AstNode> userObject)  
      JavaScriptTreeNode​(org.mozilla.javascript.ast.AstNode userObject)  
      JavaScriptTreeNode​(org.mozilla.javascript.ast.AstNode userObject, boolean sorted)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.Icon getIcon()  
      int getLength()
      Returns the length in the document of this source element.
      int getOffset()
      Returns the offset into the document of this source element.
      java.lang.String getText​(boolean selected)  
      void setIcon​(javax.swing.Icon icon)  
      void setOffset​(javax.swing.text.Position offs)
      Sets the absolute offset of this element in the document.
      void setText​(java.lang.String text)
      Sets the text to display in the tree for this node.
      java.lang.String toString()
      Overridden to return the textual representation displayed in the tree view.
      • Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

        breadthFirstEnumeration, depthFirstEnumeration, getAllowsChildren, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, 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

      • pos

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

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

        private javax.swing.Icon icon
        The icon this node displays in the tree.
    • Constructor Detail

      • JavaScriptTreeNode

        public JavaScriptTreeNode​(java.util.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 Detail

      • getIcon

        public javax.swing.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()
      • 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:
        getLength()
      • getText

        public java.lang.String getText​(boolean selected)
      • setIcon

        public void setIcon​(javax.swing.Icon icon)
      • setOffset

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

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

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