asksAllowsChildren
protected boolean asksAllowsChildren
Determines how the isLeaf method figures out if a node is a leaf node. If true, a node is a leaf node if it does not allow children. (If it allows children, it is not a leaf node, even if no children are present.) That lets you distinguish between folder nodes and file nodes in a file system, for example.
If this value is false, then any node which has no children is a leaf node, and any node may acquire children.
See Also:
TreeNode.getAllowsChildren(), TreeModel.isLeaf(java.lang.Object), setAsksAllowsChildren(boolean)
setAsksAllowsChildren
public void setAsksAllowsChildren(boolean newValue)
Sets whether or not to test leafness by asking getAllowsChildren() or isLeaf() to the TreeNodes. If newvalue is true, getAllowsChildren() is messaged, otherwise isLeaf() is messaged.
asksAllowsChildren
public boolean asksAllowsChildren()
Tells how leaf nodes are determined.
Returns:
true if only nodes which do not allow children are leaf nodes, false if nodes which have no children (even if allowed) are leaf nodes
See Also:
asksAllowsChildren
isLeaf
public boolean isLeaf(Object node)
Returns whether the specified node is a leaf node. The way the test is performed depends on the askAllowsChildren setting.
Specified by:
isLeaf in interface TreeModel
Parameters:
node - the node to check
Returns:
true if the node is a leaf node
See Also:
asksAllowsChildren, TreeModel.isLeaf(java.lang.Object)
Partager