|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode org.fife.rtext.plugins.sourcebrowser.SourceTreeNode
public class SourceTreeNode
Base class for tree nodes in an DefaultSourceTree
. They can
be sorted and filtered based on user input.
This class is a clone of the identical class in
RSTALanguageSupport
, but unfortunately exists to prevent
a dependency on that library in this plugin.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
SourceTreeNode(java.lang.Object userObject)
|
|
SourceTreeNode(java.lang.Object userObject,
boolean sorted)
|
Method Summary | |
---|---|
void |
add(javax.swing.tree.MutableTreeNode child)
|
java.util.Enumeration<?> |
children()
|
int |
compareTo(java.lang.Object obj)
|
java.util.Comparator<java.lang.Object> |
createComparator()
Returns a comparator used to sort the child nodes of this node. |
protected void |
filter(java.lang.String prefix)
Filters the children of this tree node based on the specified prefix. |
javax.swing.tree.TreeNode |
getChildAfter(javax.swing.tree.TreeNode child)
|
javax.swing.tree.TreeNode |
getChildAt(int index)
|
javax.swing.tree.TreeNode |
getChildBefore(javax.swing.tree.TreeNode child)
|
int |
getChildCount()
|
int |
getIndex(javax.swing.tree.TreeNode child)
|
int |
getSortPriority()
Returns the relative priority of this node against others when being sorted (lower is higher priority). |
boolean |
isSortable()
Returns whether this particular node's children can be sorted. |
boolean |
isSorted()
Returns whether this node is sorted. |
protected void |
refresh()
|
void |
setSortable(boolean sortable)
Sets whether this particular node's children are sortable. |
void |
setSorted(boolean sorted)
Sets whether this tree node (and any child sortable tree nodes) are sorting their children. |
void |
setSortPriority(int priority)
Sets the relative sort priority of this tree node when it is compared against others (lower is higher priority). |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
breadthFirstEnumeration, clone, 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, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SourceTreeNode(java.lang.Object userObject)
public SourceTreeNode(java.lang.Object userObject, boolean sorted)
Method Detail |
---|
public void add(javax.swing.tree.MutableTreeNode child)
add
in class javax.swing.tree.DefaultMutableTreeNode
public java.util.Enumeration<?> children()
children
in interface javax.swing.tree.TreeNode
children
in class javax.swing.tree.DefaultMutableTreeNode
public int compareTo(java.lang.Object obj)
public java.util.Comparator<java.lang.Object> createComparator()
protected void filter(java.lang.String prefix)
prefix
- The prefix. If this is null
, all possible
children are shown. This should be all lower case.public javax.swing.tree.TreeNode getChildAfter(javax.swing.tree.TreeNode child)
getChildAfter
in class javax.swing.tree.DefaultMutableTreeNode
public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class javax.swing.tree.DefaultMutableTreeNode
public javax.swing.tree.TreeNode getChildBefore(javax.swing.tree.TreeNode child)
getChildBefore
in class javax.swing.tree.DefaultMutableTreeNode
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class javax.swing.tree.DefaultMutableTreeNode
public int getIndex(javax.swing.tree.TreeNode child)
getIndex
in interface javax.swing.tree.TreeNode
getIndex
in class javax.swing.tree.DefaultMutableTreeNode
public int getSortPriority()
setSortPriority(int)
public boolean isSortable()
setSortable(boolean)
public boolean isSorted()
protected void refresh()
public void setSortable(boolean sortable)
sortable
- Whether this node's children are sortable.isSortable()
public void setSorted(boolean sorted)
sorted
- Whether sorting is enabled.isSorted()
public void setSortPriority(int priority)
priority
- The relative priority.getSortPriority()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |