|
||||||||||
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 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 Object |
userObject
optional user object |
Constructor Summary | |
---|---|
AbstractMutableTreeTableNode()
|
|
AbstractMutableTreeTableNode(Object userObject)
|
|
AbstractMutableTreeTableNode(Object userObject,
boolean allowsChildren)
|
Method Summary | |
---|---|
void |
add(MutableTreeTableNode child)
|
Enumeration<? extends MutableTreeTableNode> |
children()
Returns an enumeration this node's children. |
protected List<MutableTreeTableNode> |
createChildrenList()
Creates the list used to manage the children of this node. |
boolean |
getAllowsChildren()
Returns true if the receiver allows children. |
TreeTableNode |
getChildAt(int childIndex)
Overridden to specify the return type. |
int |
getChildCount()
Returns the number of children TreeNode s the receiver
contains. |
int |
getIndex(TreeNode node)
Returns the index of node in the receivers children. |
TreeTableNode |
getParent()
Overridden to specify the return type. |
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()
Returns true if the receiver is a leaf. |
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(Object object)
Sets the user object stored in this node. |
void |
setValueAt(Object aValue,
int column)
Sets the value for the given column . |
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 List<MutableTreeTableNode> children
protected transient Object userObject
protected boolean allowsChildren
Constructor Detail |
---|
public AbstractMutableTreeTableNode()
public AbstractMutableTreeTableNode(Object userObject)
public AbstractMutableTreeTableNode(Object userObject, boolean allowsChildren)
Method Detail |
---|
protected List<MutableTreeTableNode> createChildrenList()
This method is called by the constructor.
null
public 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 MutableTreeTableNode
child
- 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 MutableTreeTableNode
index
- 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 MutableTreeTableNode
node
- the index of the childpublic void removeFromParent()
getParent().remove(this)
.
removeFromParent
in interface MutableTreeTableNode
public void setParent(MutableTreeTableNode newParent)
newParent
. This methods remove
the node from its old parent.
setParent
in interface MutableTreeTableNode
newParent
- the new parent for this nodepublic Object getUserObject()
getUserObject
in interface TreeTableNode
setUserObject(java.lang.Object)
,
toString()
public void setUserObject(Object object)
setUserObject
in interface TreeTableNode
object
- 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 TreeNode
getChildAt
in interface TreeTableNode
childIndex
- the index of the child
TreeTableNode
corresponding to the specified indexpublic int getIndex(TreeNode node)
node
in the receivers children.
If the receiver does not contain node
, -1 will be
returned.
getIndex
in interface TreeNode
public TreeTableNode getParent()
TreeTableNode
of the receiver.
getParent
in interface TreeNode
getParent
in interface TreeTableNode
TreeTableNode
or null
if this node has
no parent (such nodes are usually root nodes).public Enumeration<? extends MutableTreeTableNode> children()
children
in interface TreeNode
children
in interface MutableTreeTableNode
children
in interface TreeTableNode
TreeTableNode
spublic boolean getAllowsChildren()
getAllowsChildren
in interface TreeNode
public 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()
TreeNode
s the receiver
contains.
getChildCount
in interface TreeNode
public boolean isLeaf()
isLeaf
in interface TreeNode
public boolean isEditable(int column)
isEditable
in interface TreeTableNode
column
- the column to query
false
public void setValueAt(Object aValue, int column)
column
.
setValueAt
in interface TreeTableNode
aValue
- the value to setcolumn
- the column to set the value onpublic String toString()
toString()
to this node's
user object, or null if this node has no user object.
toString
in class Object
getUserObject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |