JIDE 3.5.15

com.jidesoft.grid
Class DefaultWrappedRow

java.lang.Object
  extended by com.jidesoft.grid.DefaultWrappedRow
All Implemented Interfaces:
Expandable, ExpandableRow, Node, Row, WrappedRow

public class DefaultWrappedRow
extends Object
implements ExpandableRow, WrappedRow

The default wrapped row class used by ColumnTableModelWrapper.

Since:
3.4.1

Field Summary
 
Fields inherited from interface com.jidesoft.grid.Expandable
PROPERTY_EXPANDABLE, PROPERTY_EXPANDED
 
Fields inherited from interface com.jidesoft.grid.Node
PROPERTY_ADJUSTING
 
Constructor Summary
DefaultWrappedRow(ColumnTableModelWrapper wrapperModel, ExpandableRow originalRow)
          The constructor.
 
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.
 void cellUpdated(int columnIndex)
          Notifies the cell at the specified column is updated.
 boolean equals(Object obj)
           
 int getAllVisibleChildrenCount()
          Gets the children count after filtering.
 Class<?> getCellClassAt(int columnIndex)
          Gets the type for the cell at columnIndex.
 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.
 ConverterContext getConverterContextAt(int columnIndex)
          Gets the converter context for the cell at columnIndex.
 EditorContext getEditorContextAt(int columnIndex)
          Gets the editor context for the cell at columnIndex.
 int getLevel()
          Gets the number of level counting from the first level.
 Node getNextSibling()
          Gets next sibling of current node.
 int getNumberOfVisibleExpandable()
          Gets the number of visible expandable, include itself.
 ExpandableRow getOriginalRow()
          Gets the original row.
 Expandable getParent()
          Gets the parent of this expandable.
 Node getPreviousSibling()
          Gets previous sibling of current node.
 Object getValueAt(int columnIndex)
          Gets the value for cell at columnIndex
 boolean hasChildren()
          Checks if the expandable has children.
 int hashCode()
           
 boolean isCellEditable(int columnIndex)
          Returns true if the cell at columnIndex is editable.
 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 notifyCellUpdated(Object child, int columnIndex)
          Notifies the child is updated.
 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 rowUpdated()
          Notifies the row is updated.
 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.
 void setParent(Expandable parent)
          Sets the parent of this expandable.
 void setValueAt(Object value, int columnIndex)
          Sets the value in the cell at columnIndex.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWrappedRow

public DefaultWrappedRow(ColumnTableModelWrapper wrapperModel,
                         ExpandableRow originalRow)
The constructor.

Parameters:
wrapperModel - the column wrapper table model
originalRow - the original row
Method Detail

getOriginalRow

public ExpandableRow getOriginalRow()
Description copied from interface: WrappedRow
Gets the original row.

Specified by:
getOriginalRow in interface WrappedRow
Returns:
the original row.

isCellEditable

public boolean isCellEditable(int columnIndex)
Description copied from interface: Row
Returns true if the cell at columnIndex is editable. Otherwise, setValueAt on the cell will not change the value of that cell.

Specified by:
isCellEditable in interface Row
Parameters:
columnIndex - the column whose value to be queried
Returns:
true if the cell is editable
See Also:
Row.setValueAt(java.lang.Object, int)

getValueAt

public Object getValueAt(int columnIndex)
Description copied from interface: Row
Gets the value for cell at columnIndex

Specified by:
getValueAt in interface Row
Parameters:
columnIndex - the column whose value to be queried
Returns:
the value at the specified cell.

setValueAt

public void setValueAt(Object value,
                       int columnIndex)
Description copied from interface: Row
Sets the value in the cell at columnIndex.

Specified by:
setValueAt in interface Row
Parameters:
value - the new value
columnIndex - the column whose value is to be changed
See Also:
Row.getValueAt(int), Row.isCellEditable(int)

getConverterContextAt

public ConverterContext getConverterContextAt(int columnIndex)
Description copied from interface: Row
Gets the converter context for the cell at columnIndex.

Specified by:
getConverterContextAt in interface Row
Parameters:
columnIndex - the column index
Returns:
the converter context for the specified cell.

getEditorContextAt

public EditorContext getEditorContextAt(int columnIndex)
Description copied from interface: Row
Gets the editor context for the cell at columnIndex.

Specified by:
getEditorContextAt in interface Row
Parameters:
columnIndex - the column index
Returns:
the editor context for the specified cell.

getCellClassAt

public Class<?> getCellClassAt(int columnIndex)
Description copied from interface: Row
Gets the type for the cell at columnIndex.

Specified by:
getCellClassAt in interface Row
Parameters:
columnIndex - the column index
Returns:
the type for the specified cell.

cellUpdated

public void cellUpdated(int columnIndex)
Description copied from interface: Row
Notifies the cell at the specified column is updated.

Specified by:
cellUpdated in interface Row
Parameters:
columnIndex - the column index the column index.

rowUpdated

public void rowUpdated()
Description copied from interface: Row
Notifies the row is updated. You can call this method if any of the cells are changed. But if you know exactly which cell is changed, you should use Row.cellUpdated(int) instead.

Specified by:
rowUpdated in interface Row

getLevel

public int getLevel()
Description copied from interface: Node
Gets the number of level counting from the first level. If the expandable doesn't have any parent, the level will be 0.

Specified by:
getLevel in interface Node
Returns:
the number of level above

getParent

public Expandable getParent()
Description copied from interface: Node
Gets the parent of this expandable.

Specified by:
getParent in interface Node
Returns:
the parent

setParent

public void setParent(Expandable parent)
Description copied from interface: Node
Sets the parent of this expandable.

Specified by:
setParent in interface Node

getPreviousSibling

public Node getPreviousSibling()
Description copied from interface: Node
Gets previous sibling of current node.

Specified by:
getPreviousSibling in interface Node
Returns:
previous sibling if exists.

getNextSibling

public Node getNextSibling()
Description copied from interface: Node
Gets next sibling of current node.

Specified by:
getNextSibling in interface Node
Returns:
next sibling if exists.

notifyCellUpdated

public void notifyCellUpdated(Object child,
                              int columnIndex)
Description copied from interface: ExpandableRow
Notifies the child is updated.

Specified by:
notifyCellUpdated in interface ExpandableRow
Parameters:
child - the child which is updated
columnIndex - the column index.

isExpanded

public boolean isExpanded()
Description copied from interface: Expandable
Checks if it is expanded.

Specified by:
isExpanded in interface Expandable
Returns:
true if it is expanded

setExpanded

public void setExpanded(boolean expanded)
Description copied from interface: Expandable
Sets the expanded attribute.

Specified by:
setExpanded in interface Expandable
Parameters:
expanded - true or false

isExpandable

public boolean isExpandable()
Description copied from interface: Expandable
Checks if it is expandable. If it's not expandable, the expand icon should be grayed out.

Specified by:
isExpandable in interface Expandable
Returns:
true if it is expandable

setExpandable

public void setExpandable(boolean expandable)
Description copied from interface: Expandable
Sets the expandable attribute.

Specified by:
setExpandable in interface Expandable
Parameters:
expandable - true or false.

hasChildren

public boolean hasChildren()
Description copied from interface: Expandable
Checks if the expandable has children.

Specified by:
hasChildren in interface Expandable
Returns:
true if it has children

removeAllChildren

public void removeAllChildren()
Description copied from interface: Expandable
Removes all children from this expandable.

Specified by:
removeAllChildren in interface Expandable

getChildrenCount

public int getChildrenCount()
Description copied from interface: Expandable
Gets the children count.

Specified by:
getChildrenCount in interface Expandable
Returns:
the children count.

getAllVisibleChildrenCount

public int getAllVisibleChildrenCount()
Description copied from interface: Expandable
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.

Specified by:
getAllVisibleChildrenCount in interface Expandable
Returns:
the children count after filtering.

getChildren

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

Specified by:
getChildren in interface Expandable
Returns:
the list of children

setChildren

public void setChildren(List<?> children)
Description copied from interface: Expandable
Sets the list of children.

Specified by:
setChildren in interface Expandable
Parameters:
children - the list of children

addChild

public Object addChild(Object child)
Description copied from interface: Expandable
Adds child to the list of children. It will be added to the last one in the list.

Specified by:
addChild in interface Expandable
Parameters:
child - the child to be added.
Returns:
the newly added child.

addChild

public Object addChild(int index,
                       Object child)
Description copied from interface: Expandable
Adds a child to the list of children at the specified index.

Specified by:
addChild in interface Expandable
Parameters:
index - the index where the child will be added.
child - the child to be added.
Returns:
the newly added child.

addChildren

public void addChildren(int index,
                        List<? extends Row> children)
Description copied from interface: Expandable
Adds a list of children.

Specified by:
addChildren in interface Expandable
Parameters:
index - the index where the children to be inserted.
children - the children to be added.

removeChild

public boolean removeChild(Object child)
Description copied from interface: Expandable
Removes child from the list of children.

Specified by:
removeChild in interface Expandable
Parameters:
child - the child to be removed.
Returns:
true if child is removed. false if the child doesn't exist at all.

removeChildren

public boolean removeChildren(List<? extends Row> children)
Description copied from interface: Expandable
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);
 

Specified by:
removeChildren in interface Expandable
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

public boolean moveUpChild(Object child)
Description copied from interface: Expandable
Moves up the child in the children list.

Specified by:
moveUpChild in interface Expandable
Parameters:
child - the child to be moved up.
Returns:
true if the child is moved up. Otherwise false.

moveDownChild

public boolean moveDownChild(Object child)
Description copied from interface: Expandable
Moves down the child in the children list.

Specified by:
moveDownChild in interface Expandable
Parameters:
child - the child to be moved down.
Returns:
true if the child is moved down. Otherwise false.

getChildIndex

public int getChildIndex(Object child)
Description copied from interface: Expandable
Gets the index of the child if exists.

Specified by:
getChildIndex in interface Expandable
Parameters:
child - the child
Returns:
the index of the child if it exists. Otherwise, return -1.

getChildAt

public Object getChildAt(int index)
Description copied from interface: Expandable
Gets child at certain index.

Specified by:
getChildAt in interface Expandable
Parameters:
index - the index of the child.
Returns:
the child at the certain index.

getNumberOfVisibleExpandable

public int getNumberOfVisibleExpandable()
Description copied from interface: Expandable
Gets the number of visible expandable, include itself.

Specified by:
getNumberOfVisibleExpandable in interface Expandable
Returns:
the number of visible expandable

notifyChildInserted

public void notifyChildInserted(Object child,
                                int childIndex)
Description copied from interface: Expandable
Notifies the child is inserted as the specified index of this expandable.

Specified by:
notifyChildInserted in interface 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

public void notifyChildrenInserted(List children,
                                   int firstIndex)
Description copied from interface: Expandable
Notifies the children are inserted as the specified index arrange of this expandable.

Specified by:
notifyChildrenInserted in interface Expandable
Parameters:
children - the children which are inserted.
firstIndex - the first index where it is inserted.

notifyChildDeleted

public void notifyChildDeleted(Object child)
Description copied from interface: Expandable
Notifies a child is deleted.

Specified by:
notifyChildDeleted in interface Expandable
Parameters:
child - the child that is deleted

notifyChildrenDeleted

public void notifyChildrenDeleted(List<? extends Row> children)
Description copied from interface: Expandable
Notifies the children are deleted.

Specified by:
notifyChildrenDeleted in interface Expandable
Parameters:
children - the children that are deleted

notifyChildUpdated

public void notifyChildUpdated(Object child)
Description copied from interface: Expandable
Notifies the child is updated.

Specified by:
notifyChildUpdated in interface Expandable
Parameters:
child - the child which is updated

notifyChildrenUpdated

public void notifyChildrenUpdated(List<? extends Row> children)
Description copied from interface: Expandable
Notifies the children are updated.

Specified by:
notifyChildrenUpdated in interface Expandable
Parameters:
children - the children which are updated

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

JIDE 3.5.15