Package org.fife.rsta.ac.js.tree
Class JavaScriptTreeNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- org.fife.rsta.ac.SourceTreeNode
-
- org.fife.rsta.ac.js.tree.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
-
-
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.IcongetIcon()intgetLength()Returns the length in the document of this source element.intgetOffset()Returns the offset into the document of this source element.java.lang.StringgetText(boolean selected)voidsetIcon(javax.swing.Icon icon)voidsetOffset(javax.swing.text.Position offs)Sets the absolute offset of this element in the document.voidsetText(java.lang.String text)Sets the text to display in the tree for this node.java.lang.StringtoString()Overridden to return the textual representation displayed in the tree view.-
Methods inherited from class org.fife.rsta.ac.SourceTreeNode
add, children, clone, cloneWithChildren, compareTo, filter, getChildAfter, getChildAt, getChildBefore, getChildCount, getIndex, getSortPriority, isSortable, isSorted, refresh, setSortable, setSorted, setSortPriority
-
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
-
-
-
-
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:
toStringin classjavax.swing.tree.DefaultMutableTreeNode- Returns:
- The text of this tree node.
-
-