Package org.fife.rsta.ac.java.tree
Class JavaTreeNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- org.fife.rsta.ac.SourceTreeNode
-
- org.fife.rsta.ac.java.tree.JavaTreeNode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<SourceTreeNode>,javax.swing.tree.MutableTreeNode,javax.swing.tree.TreeNode
- Direct Known Subclasses:
LocalVarTreeNode,MemberTreeNode,TypeDeclarationTreeNode
class JavaTreeNode extends SourceTreeNode
Base class for nodes in the Java outline tree.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private ASTNodeastNodeprivate javax.swing.Iconiconprotected static intPRIORITY_BOOST_STATICprotected static intPRIORITY_CONSTRUCTORprotected static intPRIORITY_FIELDprotected static intPRIORITY_LOCAL_VARprotected static intPRIORITY_METHODprotected static intPRIORITY_TYPE
-
Constructor Summary
Constructors Modifier Constructor Description (package private)JavaTreeNode(java.lang.String text, java.lang.String iconName)(package private)JavaTreeNode(java.lang.String text, java.lang.String iconName, boolean sorted)protectedJavaTreeNode(ASTNode node)protectedJavaTreeNode(ASTNode node, java.lang.String iconName)protectedJavaTreeNode(ASTNode node, java.lang.String iconName, boolean sorted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(SourceTreeNode obj)Overridden to compare tree text without HTML.ASTNodegetASTNode()javax.swing.IcongetIcon()java.lang.StringgetText(boolean selected)voidsetIcon(javax.swing.Icon icon)java.lang.StringtoString()Overridden to return the same thing as getText(false), so we look nice with ToolTipTrees.-
Methods inherited from class org.fife.rsta.ac.SourceTreeNode
add, children, clone, cloneWithChildren, 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
-
-
-
-
Field Detail
-
astNode
private ASTNode astNode
-
icon
private javax.swing.Icon icon
-
PRIORITY_TYPE
protected static final int PRIORITY_TYPE
- See Also:
- Constant Field Values
-
PRIORITY_FIELD
protected static final int PRIORITY_FIELD
- See Also:
- Constant Field Values
-
PRIORITY_CONSTRUCTOR
protected static final int PRIORITY_CONSTRUCTOR
- See Also:
- Constant Field Values
-
PRIORITY_METHOD
protected static final int PRIORITY_METHOD
- See Also:
- Constant Field Values
-
PRIORITY_LOCAL_VAR
protected static final int PRIORITY_LOCAL_VAR
- See Also:
- Constant Field Values
-
PRIORITY_BOOST_STATIC
protected static final int PRIORITY_BOOST_STATIC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JavaTreeNode
protected JavaTreeNode(ASTNode node)
-
JavaTreeNode
protected JavaTreeNode(ASTNode node, java.lang.String iconName)
-
JavaTreeNode
protected JavaTreeNode(ASTNode node, java.lang.String iconName, boolean sorted)
-
JavaTreeNode
JavaTreeNode(java.lang.String text, java.lang.String iconName)
-
JavaTreeNode
JavaTreeNode(java.lang.String text, java.lang.String iconName, boolean sorted)
-
-
Method Detail
-
compareTo
public int compareTo(SourceTreeNode obj)
Overridden to compare tree text without HTML.- Specified by:
compareToin interfacejava.lang.Comparable<SourceTreeNode>- Overrides:
compareToin classSourceTreeNode- Parameters:
obj- A tree node to compare to.- Returns:
- How these tree nodes compare relative to each other.
-
getASTNode
public ASTNode getASTNode()
-
getIcon
public javax.swing.Icon getIcon()
-
getText
public java.lang.String getText(boolean selected)
-
setIcon
public void setIcon(javax.swing.Icon icon)
-
toString
public java.lang.String toString()
Overridden to return the same thing as getText(false), so we look nice with ToolTipTrees.- Overrides:
toStringin classjavax.swing.tree.DefaultMutableTreeNode- Returns:
- A string representation of this tree node.
-
-