JIDE 3.5.15

com.jidesoft.grid
Class DefaultExpandable

java.lang.Object
  extended by com.jidesoft.grid.AbstractNode
      extended by com.jidesoft.grid.AbstractExpandable
          extended by com.jidesoft.grid.DefaultExpandable
All Implemented Interfaces:
Expandable, Node
Direct Known Subclasses:
DefaultExpandableRow, DefaultExpandableValue, DummyValue, GrandTotalValue, RunningSummaryValue, SummaryValue

public class DefaultExpandable
extends AbstractExpandable

A default implementation of Expandable.


Field Summary
protected  List<?> _children
          The children.
static Enumeration<Object> EMPTY_ENUMERATION
           
static String PROPERTY_CHILDREN
           
 
Fields inherited from class com.jidesoft.grid.AbstractExpandable
_expandable, _expanded
 
Fields inherited from class com.jidesoft.grid.AbstractNode
_parent, PROPERTY_PARENT
 
Fields inherited from interface com.jidesoft.grid.Expandable
PROPERTY_EXPANDABLE, PROPERTY_EXPANDED
 
Fields inherited from interface com.jidesoft.grid.Node
PROPERTY_ADJUSTING
 
Constructor Summary
DefaultExpandable()
           
DefaultExpandable(List<Row> children)
           
 
Method Summary
 Enumeration breadthFirstEnumeration()
          Creates and returns an enumeration that traverses the subtree rooted at this node in breadth-first order.
 Enumeration depthFirstEnumeration()
          Creates and returns an enumeration that traverses the subtree rooted at this node in depth-first order.
 List<?> getChildren()
          Gets the list of children.
 Enumeration postorderEnumeration()
          Creates and returns an enumeration that traverses the subtree rooted at this node in postorder.
 Enumeration preorderEnumeration()
          Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.
 void setChildren(List<?> children)
          Sets the children for this Expandable.
 
Methods inherited from class com.jidesoft.grid.AbstractExpandable
addChild, addChild, addChildren, getAllChildrenCount, getAllVisibleChildrenCount, getChildAt, getChildIndex, getChildrenCount, getNumberOfVisibleChildren, getNumberOfVisibleExpandable, getTreeTableModel, hasChildren, hasVisibleChildren, isAdjusting, isExpandable, isExpanded, moveDownChild, moveUpChild, notifyChildDeleted, notifyChildInserted, notifyChildrenDeleted, notifyChildrenInserted, notifyChildrenUpdated, notifyChildUpdated, removeAllChildren, removeChild, removeChildren, setAdjusting, setExpandable, setExpanded
 
Methods inherited from class com.jidesoft.grid.AbstractNode
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getLevel, getNextSibling, getParent, getPreviousSibling, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.grid.Node
getLevel, getNextSibling, getParent, getPreviousSibling, setParent
 

Field Detail

_children

protected List<?> _children
The children.


PROPERTY_CHILDREN

public static final String PROPERTY_CHILDREN
See Also:
Constant Field Values

EMPTY_ENUMERATION

public static final Enumeration<Object> EMPTY_ENUMERATION
Constructor Detail

DefaultExpandable

public DefaultExpandable()

DefaultExpandable

public DefaultExpandable(List<Row> children)
Method Detail

getChildren

public List<?> getChildren()
Description copied from interface: Expandable
Gets the list of children.

Returns:
the list of children

setChildren

public void setChildren(List<?> children)
Sets the children for this Expandable. Unless the Expandable is not added to a TreeTableModel yet, otherwise do not use this method but use AbstractExpandable.addChild(Object) instead. Nor should you use getChildren().add(...) because both setChildren and getChildren().add will not notify the TreeTableModel about the change.

Parameters:
children - the new children

preorderEnumeration

public Enumeration preorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in preorder. The first node returned by the enumeration's nextElement() method is this node.

Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.

Returns:
an enumeration for traversing the tree in preorder
See Also:
postorderEnumeration()

postorderEnumeration

public Enumeration postorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in postorder. The first node returned by the enumeration's nextElement() method is the leftmost leaf. This is the same as a depth-first traversal.

Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.

Returns:
an enumeration for traversing the tree in postorder
See Also:
depthFirstEnumeration(), preorderEnumeration()

breadthFirstEnumeration

public Enumeration breadthFirstEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in breadth-first order. The first node returned by the enumeration's nextElement() method is this node.

Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.

Returns:
an enumeration for traversing the tree in breadth-first order
See Also:
depthFirstEnumeration()

depthFirstEnumeration

public Enumeration depthFirstEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in depth-first order. The first node returned by the enumeration's nextElement() method is the leftmost leaf. This is the same as a postorder traversal.

Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.

Returns:
an enumeration for traversing the tree in depth-first order
See Also:
breadthFirstEnumeration(), postorderEnumeration()

JIDE 3.5.15