JIDE 3.5.15

com.jidesoft.grid
Interface Expandable

All Superinterfaces:
Node
All Known Subinterfaces:
ExpandableCell, ExpandableRow, ExpandableValue, GanttEntry<T>, MutableGanttEntry<T>, SubEntryGanttEntry<T>
All Known Implementing Classes:
AbstractExpandable, AbstractExpandableRow, AbstractGroupRow, BeanProperty, ChildBeanProperty, DefaultExpandable, DefaultExpandableRow, DefaultExpandableValue, DefaultGanttEntry, DefaultGroupRow, DefaultProperty, DefaultWrappedRow, DummyValue, GrandTotalValue, Property, RootExpandableRow, RunningSummaryValue, SummaryValue, TableUtils.ColumnSelectionRow

public interface Expandable
extends Node

An interface to indicate an object that has children and can be expanded and collapsed.


Field Summary
static String PROPERTY_EXPANDABLE
           
static String PROPERTY_EXPANDED
           
 
Fields inherited from interface com.jidesoft.grid.Node
PROPERTY_ADJUSTING
 
Method Summary
 Object addChild(int index, Object child)
          Adds a child to the list of children at the specified index.
 Object addChild(Object child)
          Adds child to the list of children.
 void addChildren(int index, List<? extends Row> children)
          Adds a list of children.
 int getAllVisibleChildrenCount()
          Gets the children count after filtering.
 Object getChildAt(int index)
          Gets child at certain index.
 int getChildIndex(Object child)
          Gets the index of the child if exists.
 List<?> getChildren()
          Gets the list of children.
 int getChildrenCount()
          Gets the children count.
 int getNumberOfVisibleExpandable()
          Gets the number of visible expandable, include itself.
 boolean hasChildren()
          Checks if the expandable has children.
 boolean isExpandable()
          Checks if it is expandable.
 boolean isExpanded()
          Checks if it is expanded.
 boolean moveDownChild(Object child)
          Moves down the child in the children list.
 boolean moveUpChild(Object child)
          Moves up the child in the children list.
 void notifyChildDeleted(Object child)
          Notifies a child is deleted.
 void notifyChildInserted(Object child, int childIndex)
          Notifies the child is inserted as the specified index of this expandable.
 void notifyChildrenDeleted(List<? extends Row> children)
          Notifies the children are deleted.
 void notifyChildrenInserted(List children, int firstIndex)
          Notifies the children are inserted as the specified index arrange of this expandable.
 void notifyChildrenUpdated(List<? extends Row> children)
          Notifies the children are updated.
 void notifyChildUpdated(Object child)
          Notifies the child is updated.
 void removeAllChildren()
          Removes all children from this expandable.
 boolean removeChild(Object child)
          Removes child from the list of children.
 boolean removeChildren(List<? extends Row> children)
          Removes children from the list of children.
 void setChildren(List<?> children)
          Sets the list of children.
 void setExpandable(boolean expandable)
          Sets the expandable attribute.
 void setExpanded(boolean expanded)
          Sets the expanded attribute.
 
Methods inherited from interface com.jidesoft.grid.Node
getLevel, getNextSibling, getParent, getPreviousSibling, setParent
 

Field Detail

PROPERTY_EXPANDED

static final String PROPERTY_EXPANDED
See Also:
Constant Field Values

PROPERTY_EXPANDABLE

static final String PROPERTY_EXPANDABLE
See Also:
Constant Field Values
Method Detail

isExpanded

boolean isExpanded()
Checks if it is expanded.

Returns:
true if it is expanded

setExpanded

void setExpanded(boolean expanded)
Sets the expanded attribute.

Parameters:
expanded - true or false

isExpandable

boolean isExpandable()
Checks if it is expandable. If it's not expandable, the expand icon should be grayed out.

Returns:
true if it is expandable

setExpandable

void setExpandable(boolean expandable)
Sets the expandable attribute.

Parameters:
expandable - true or false.

hasChildren

boolean hasChildren()
Checks if the expandable has children.

Returns:
true if it has children

removeAllChildren

void removeAllChildren()
Removes all children from this expandable.


getChildrenCount

int getChildrenCount()
Gets the children count.

Returns:
the children count.

getAllVisibleChildrenCount

int getAllVisibleChildrenCount()
Gets the children count after filtering. This method will only work if the Row implements Cachedable. In the other word, this method will not do the filter. It will simply look at the cached value after filtered was done by FilterableTreeTableModel.

Returns:
the children count after filtering.

getChildren

List<?> getChildren()
Gets the list of children.

Returns:
the list of children

setChildren

void setChildren(List<?> children)
Sets the list of children.

Parameters:
children - the list of children

addChild

Object addChild(Object child)
Adds child to the list of children. It will be added to the last one in the list.

Parameters:
child - the child to be added.
Returns:
the newly added child.

addChild

Object addChild(int index,
                Object child)
Adds a child to the list of children at the specified index.

Parameters:
index - the index where the child will be added.
child - the child to be added.
Returns:
the newly added child.

addChildren

void addChildren(int index,
                 List<? extends Row> children)
Adds a list of children.

Parameters:
index - the index where the children to be inserted.
children - the children to be added.

removeChild

boolean removeChild(Object child)
Removes child from the list of children.

Parameters:
child - the child to be removed.
Returns:
true if child is removed. false if the child doesn't exist at all.

removeChildren

boolean removeChildren(List<? extends Row> children)
Removes children from the list of children.

It's not correct if you invoke this method without creating a new list. For example, the following line is incorrect.

 removeChildren(getChildren());
 
You would use the following line to remove all children.
 List children = getChildren();
 List cloneList = new ArrayList();
 cloneList.addAll(children);
 removeChildren(cloneList);
 

Parameters:
children - the child to be removed.
Returns:
true if children are all removed. false if no element of the children exists at all.

moveUpChild

boolean moveUpChild(Object child)
Moves up the child in the children list.

Parameters:
child - the child to be moved up.
Returns:
true if the child is moved up. Otherwise false.

moveDownChild

boolean moveDownChild(Object child)
Moves down the child in the children list.

Parameters:
child - the child to be moved down.
Returns:
true if the child is moved down. Otherwise false.

getChildIndex

int getChildIndex(Object child)
Gets the index of the child if exists.

Parameters:
child - the child
Returns:
the index of the child if it exists. Otherwise, return -1.

getChildAt

Object getChildAt(int index)
Gets child at certain index.

Parameters:
index - the index of the child.
Returns:
the child at the certain index.

getNumberOfVisibleExpandable

int getNumberOfVisibleExpandable()
Gets the number of visible expandable, include itself.

Returns:
the number of visible expandable

notifyChildInserted

void notifyChildInserted(Object child,
                         int childIndex)
Notifies the child is inserted as the specified index of this expandable.

Parameters:
child - the child which is inserted.
childIndex - the index where it is inserted. -1 if the child is inserted as the last one.

notifyChildrenInserted

void notifyChildrenInserted(List children,
                            int firstIndex)
Notifies the children are inserted as the specified index arrange of this expandable.

Parameters:
children - the children which are inserted.
firstIndex - the first index where it is inserted.

notifyChildDeleted

void notifyChildDeleted(Object child)
Notifies a child is deleted.

Parameters:
child - the child that is deleted

notifyChildrenDeleted

void notifyChildrenDeleted(List<? extends Row> children)
Notifies the children are deleted.

Parameters:
children - the children that are deleted

notifyChildUpdated

void notifyChildUpdated(Object child)
Notifies the child is updated.

Parameters:
child - the child which is updated

notifyChildrenUpdated

void notifyChildrenUpdated(List<? extends Row> children)
Notifies the children are updated.

Parameters:
children - the children which are updated

JIDE 3.5.15