Class RowGroup<T>
- Type Parameters:
T- the type of the row objects.
- All Implemented Interfaces:
IRowGroup<T>
IRowGroup.- Author:
- Stefan Bolton
-
Constructor Summary
ConstructorsConstructorDescriptionRowGroup(RowGroupModel<T> rowGroupModel, String groupName) RowGroup(RowGroupModel<T> rowGroupModel, String groupName, boolean collapsed) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMemberRow(T row) Adds the row into the group.voidaddMemberRows(List<T> rows) Adds multiple rows into the group.voidaddRowGroup(IRowGroup<T> rowGroup) Adds a row-group into the group.voidaddStaticMemberRow(T row) Adds a static row into the group.voidclear()Removes all member and static member rows from the group.voidcollapse()Updates the group's state to indicate it is collapsed.voidexpand()Updates the group's state to indicate it is expanded.getData()Allows some arbitrary data to be retrieved from an IRowGroup.Allows some arbitrary data to be retrieved from an IRowGroup.getMemberRows(boolean includeStaticRows) getOwnMemberRows(boolean includeStaticRows) Returns only the rows contained with this group.If this group is a nested child of another this will return the parent group.getRowGroupForRow(T row) Retrieves the sub-group for a given row member.booleanbooleanbooleanisEmpty()booleanremoveMemberRow(T row) Removes the row from the group whether it's static or non-static.voidremoveMemberRows(List<T> rows) Removes multiple rows from the group whether they are static or non-static.booleanremoveRowGroup(IRowGroup<T> rowGroup) Returns the row-group child of this group.voidsetCollapseable(boolean collapseable) voidAllows some arbitrary data to be tagged to an IRowGroup.voidAllows some arbitrary data to be tagged to an IRowGroup.voidsetParentGroup(IRowGroup<T> parentGroup) Set the specified group as the parent of this group.toString()
-
Constructor Details
-
RowGroup
-
RowGroup
-
-
Method Details
-
getGroupName
- Specified by:
getGroupNamein interfaceIRowGroup<T>- Returns:
- A Unique name for the group - it must not conflict with any other group's name.
-
getData
Description copied from interface:IRowGroupAllows some arbitrary data to be retrieved from an IRowGroup. -
getData
Description copied from interface:IRowGroupAllows some arbitrary data to be retrieved from an IRowGroup. -
setData
Description copied from interface:IRowGroupAllows some arbitrary data to be tagged to an IRowGroup. -
setData
Description copied from interface:IRowGroupAllows some arbitrary data to be tagged to an IRowGroup. -
isCollapsed
public boolean isCollapsed()- Specified by:
isCollapsedin interfaceIRowGroup<T>- Returns:
- Whether the group has been expanded or collapsed. A collapsed group will hide all members of the group apart from any 'static' rows.
-
isCollapseable
public boolean isCollapseable()- Specified by:
isCollapseablein interfaceIRowGroup<T>- Returns:
- Whether the group can be expanded or collapsed or, false if it should be locked in it's current state.
-
setCollapseable
public void setCollapseable(boolean collapseable) -
collapse
public void collapse()Description copied from interface:IRowGroupUpdates the group's state to indicate it is collapsed.
A notification should be sent to any
IRowGroupModelListeners to indicate a change in the model has occurred. -
expand
public void expand()Description copied from interface:IRowGroupUpdates the group's state to indicate it is expanded.
A notification should be sent to any
IRowGroupModelListeners to indicate a change in the model has occurred. -
addMemberRow
Description copied from interface:IRowGroupAdds the row into the group.
- Specified by:
addMemberRowin interfaceIRowGroup<T>- Parameters:
row- the row to be added
-
addStaticMemberRow
Description copied from interface:IRowGroupAdds a static row into the group. A static row is one that is always shown when the group is collapsed (summary data rows for example).
- Specified by:
addStaticMemberRowin interfaceIRowGroup<T>- Parameters:
row- the static row T to be added.
-
addMemberRows
Description copied from interface:IRowGroupAdds multiple rows into the group.
- Specified by:
addMemberRowsin interfaceIRowGroup<T>- Parameters:
rows- AListof rows T to be added.
-
removeMemberRow
Description copied from interface:IRowGroupRemoves the row from the group whether it's static or non-static.
Existing positions in the model may be bumped up if the row was not the last row in the model.
A notification should be sent to any
IRowGroupModelListeners to indicate a change in the model has occurred.- Specified by:
removeMemberRowin interfaceIRowGroup<T>- Parameters:
row- The row T to be removed.- Returns:
- true if the row existed and was removed.
-
removeMemberRows
Description copied from interface:IRowGroupRemoves multiple rows from the group whether they are static or non-static.
Existing positions in the model may be bumped up if the row was not the last row in the model.
A notification should be sent to any
IRowGroupModelListeners to indicate a change in the model has occurred.- Specified by:
removeMemberRowsin interfaceIRowGroup<T>- Parameters:
rows- AListof rows T to be added.
-
getParentGroup
Description copied from interface:IRowGroupIf this group is a nested child of another this will return the parent group.- Specified by:
getParentGroupin interfaceIRowGroup<T>- Returns:
- The parent group if this group is a nested child.
-
setParentGroup
Description copied from interface:IRowGroupSet the specified group as the parent of this group.- Specified by:
setParentGroupin interfaceIRowGroup<T>
-
addRowGroup
Description copied from interface:IRowGroupAdds a row-group into the group. Calls to getMemberRows and getStaticMemberRows will recurse through nested groups and return a flattened list of rows in all contained groups.- Specified by:
addRowGroupin interfaceIRowGroup<T>- Parameters:
rowGroup- a IHierarchicalRowGroup.
-
removeRowGroup
Description copied from interface:IRowGroupReturns the row-group child of this group.- Specified by:
removeRowGroupin interfaceIRowGroup<T>- Parameters:
rowGroup- a IHierarchicalRowGroup.- Returns:
- true if the group existed as a child and was removed.
-
getRowGroups
- Specified by:
getRowGroupsin interfaceIRowGroup<T>- Returns:
- an unmodifiable
Listof the groups which are direct children of this group.
-
getOwnMemberRows
Description copied from interface:IRowGroupReturns only the rows contained with this group. Not nested groups.- Specified by:
getOwnMemberRowsin interfaceIRowGroup<T>- Returns:
- a list of rows T.
-
getOwnStaticMemberRows
- Specified by:
getOwnStaticMemberRowsin interfaceIRowGroup<T>- Returns:
- Static rows only in this group not in nested groups.
-
clear
public void clear()Description copied from interface:IRowGroupRemoves all member and static member rows from the group. -
getMemberRows
- Specified by:
getMemberRowsin interfaceIRowGroup<T>- Parameters:
includeStaticRows- true to include the static rows false to exclude them.- Returns:
- an unmodifiable
Listof the rows (T) in theIRowGroup.
-
getStaticMemberRows
- Specified by:
getStaticMemberRowsin interfaceIRowGroup<T>- Returns:
- an unmodifiable
Listof the static rows (T) in theIRowGroup.
-
getRowGroupForRow
Description copied from interface:IRowGroupRetrieves the sub-group for a given row member.- Specified by:
getRowGroupForRowin interfaceIRowGroup<T>
-
isEmpty
public boolean isEmpty() -
toString
-