|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
public abstract class AbstractMutableTreeTableNode
AbstractMutableTreeTableNode provides an implementation of most of
the MutableTreeTableNode features.
| Field Summary | |
|---|---|
protected boolean |
allowsChildren
|
protected java.util.List<MutableTreeTableNode> |
children
List of children, if this node has no children the list will be empty. |
protected MutableTreeTableNode |
parent
this node's parent, or null if this node has no parent |
protected java.lang.Object |
userObject
optional user object |
| Constructor Summary | |
|---|---|
AbstractMutableTreeTableNode()
|
|
AbstractMutableTreeTableNode(java.lang.Object userObject)
|
|
AbstractMutableTreeTableNode(java.lang.Object userObject,
boolean allowsChildren)
|
|
| Method Summary | |
|---|---|
void |
add(MutableTreeTableNode child)
|
java.util.Enumeration<? extends MutableTreeTableNode> |
children()
Returns an enumeration this node's children. |
protected java.util.List<MutableTreeTableNode> |
createChildrenList()
Creates the list used to manage the children of this node. |
boolean |
getAllowsChildren()
|
TreeTableNode |
getChildAt(int childIndex)
Overridden to specify the return type. |
int |
getChildCount()
|
int |
getIndex(javax.swing.tree.TreeNode node)
|
TreeTableNode |
getParent()
Overridden to specify the return type. |
java.lang.Object |
getUserObject()
Returns this node's user object. |
void |
insert(MutableTreeTableNode child,
int index)
Adds the child to this node at the specified index. |
boolean |
isEditable(int column)
Determines whether the specified column is editable. |
boolean |
isLeaf()
|
void |
remove(int index)
Removes the child node at the specified index from this node. |
void |
remove(MutableTreeTableNode node)
Removes the specified child node from this node. |
void |
removeFromParent()
Removes this node from it's parent. |
void |
setAllowsChildren(boolean allowsChildren)
Determines whether or not this node is allowed to have children. |
void |
setParent(MutableTreeTableNode newParent)
Sets the parent of this node to newParent. |
void |
setUserObject(java.lang.Object object)
Sets the user object stored in this node. |
void |
setValueAt(java.lang.Object aValue,
int column)
Sets the value for the given column. |
java.lang.String |
toString()
Returns the result of sending toString() to this node's
user object, or null if this node has no user object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jdesktop.swingx.treetable.TreeTableNode |
|---|
getColumnCount, getValueAt |
| Field Detail |
|---|
protected MutableTreeTableNode parent
protected final java.util.List<MutableTreeTableNode> children
protected transient java.lang.Object userObject
protected boolean allowsChildren
| Constructor Detail |
|---|
public AbstractMutableTreeTableNode()
public AbstractMutableTreeTableNode(java.lang.Object userObject)
public AbstractMutableTreeTableNode(java.lang.Object userObject,
boolean allowsChildren)
| Method Detail |
|---|
protected java.util.List<MutableTreeTableNode> createChildrenList()
This method is called by the constructor.
nullpublic void add(MutableTreeTableNode child)
public void insert(MutableTreeTableNode child,
int index)
child to this node at the specified index. This
method calls setParent on child with this as the
parameter.
insert in interface MutableTreeTableNodechild - the node to add as a childindex - the index of the childpublic void remove(int index)
index from this node.
This method calls setParent on child with a null
parameter.
remove in interface MutableTreeTableNodeindex - the index of the childpublic void remove(MutableTreeTableNode node)
node from this node.
This method calls setParent on child with a null
parameter.
remove in interface MutableTreeTableNodenode - the index of the childpublic void removeFromParent()
getParent().remove(this).
removeFromParent in interface MutableTreeTableNodepublic void setParent(MutableTreeTableNode newParent)
newParent. This methods remove
the node from its old parent.
setParent in interface MutableTreeTableNodenewParent - the new parent for this nodepublic java.lang.Object getUserObject()
getUserObject in interface TreeTableNodesetUserObject(java.lang.Object),
toString()public void setUserObject(java.lang.Object object)
setUserObject in interface TreeTableNodeobject - the object to storepublic TreeTableNode getChildAt(int childIndex)
TreeNode
at index childIndex. Models that utilize this node should verify
the column count before querying this node, since nodes may return
differing sizes even for the same model.
getChildAt in interface javax.swing.tree.TreeNodegetChildAt in interface TreeTableNodechildIndex - the index of the child
TreeTableNode corresponding to the specified indexpublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic TreeTableNode getParent()
TreeTableNode of the receiver.
getParent in interface javax.swing.tree.TreeNodegetParent in interface TreeTableNodeTreeTableNode or null if this node has
no parent (such nodes are usually root nodes).public java.util.Enumeration<? extends MutableTreeTableNode> children()
children in interface javax.swing.tree.TreeNodechildren in interface MutableTreeTableNodechildren in interface TreeTableNodeTreeTableNodespublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic void setAllowsChildren(boolean allowsChildren)
allowsChildren is false, all of this node's children are
removed.
Note: By default, a node allows children.
allowsChildren - true if this node is allowed to have childrenpublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodepublic boolean isEditable(int column)
isEditable in interface TreeTableNodecolumn - the column to query
false
public void setValueAt(java.lang.Object aValue,
int column)
column.
setValueAt in interface TreeTableNodeaValue - the value to setcolumn - the column to set the value onpublic java.lang.String toString()
toString() to this node's
user object, or null if this node has no user object.
toString in class java.lang.ObjectgetUserObject()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||