Class RowGroup<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.group.model.RowGroup<T>
-
-
Constructor Summary
Constructors Constructor Description RowGroup(RowGroupModel<T> rowGroupModel, String groupName)
RowGroup(RowGroupModel<T> rowGroupModel, String groupName, boolean collapsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMemberRow(T row)
Adds the row into the group.void
addMemberRows(List<T> rows)
Adds multiple rows into the group.void
addRowGroup(IRowGroup<T> rowGroup)
Adds a row-group into the group.void
addStaticMemberRow(T row)
Adds a static row into the group.void
clear()
Removes all member and static member rows from the group.void
collapse()
Updates the group's state to indicate it is collapsed.void
expand()
Updates the group's state to indicate it is expanded.Object
getData()
Allows some arbitrary data to be retrieved from an IRowGroup.Object
getData(String key)
Allows some arbitrary data to be retrieved from an IRowGroup.String
getGroupName()
List<T>
getMemberRows(boolean includeStaticRows)
List<T>
getOwnMemberRows(boolean includeStaticRows)
Returns only the rows contained with this group.List<T>
getOwnStaticMemberRows()
IRowGroup<T>
getParentGroup()
If this group is a nested child of another this will return the parent group.IRowGroup<T>
getRowGroupForRow(T row)
Retrieves the sub-group for a given row member.List<IRowGroup<T>>
getRowGroups()
List<T>
getStaticMemberRows()
boolean
isCollapseable()
boolean
isCollapsed()
boolean
isEmpty()
boolean
removeMemberRow(T row)
Removes the row from the group whether it's static or non-static.void
removeMemberRows(List<T> rows)
Removes multiple rows from the group whether they are static or non-static.boolean
removeRowGroup(IRowGroup<T> rowGroup)
Returns the row-group child of this group.void
setCollapseable(boolean collapseable)
void
setData(Object data)
Allows some arbitrary data to be tagged to an IRowGroup.void
setData(String key, Object data)
Allows some arbitrary data to be tagged to an IRowGroup.void
setParentGroup(IRowGroup<T> parentGroup)
Set the specified group as the parent of this group.String
toString()
-
-
-
Constructor Detail
-
RowGroup
public RowGroup(RowGroupModel<T> rowGroupModel, String groupName)
-
RowGroup
public RowGroup(RowGroupModel<T> rowGroupModel, String groupName, boolean collapsed)
-
-
Method Detail
-
getGroupName
public String getGroupName()
- Specified by:
getGroupName
in interfaceIRowGroup<T>
- Returns:
- A Unique name for the group - it must not conflict with any other group's name.
-
getData
public Object getData()
Description copied from interface:IRowGroup
Allows some arbitrary data to be retrieved from an IRowGroup.
-
getData
public Object getData(String key)
Description copied from interface:IRowGroup
Allows some arbitrary data to be retrieved from an IRowGroup.
-
setData
public void setData(Object data)
Description copied from interface:IRowGroup
Allows some arbitrary data to be tagged to an IRowGroup.
-
setData
public void setData(String key, Object data)
Description copied from interface:IRowGroup
Allows some arbitrary data to be tagged to an IRowGroup.
-
isCollapsed
public boolean isCollapsed()
- Specified by:
isCollapsed
in 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:
isCollapseable
in 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:IRowGroup
Updates the group's state to indicate it is collapsed.
A notification should be sent to any
IRowGroupModelListener
s to indicate a change in the model has occurred.
-
expand
public void expand()
Description copied from interface:IRowGroup
Updates the group's state to indicate it is expanded.
A notification should be sent to any
IRowGroupModelListener
s to indicate a change in the model has occurred.
-
addMemberRow
public void addMemberRow(T row)
Description copied from interface:IRowGroup
Adds the row into the group.
- Specified by:
addMemberRow
in interfaceIRowGroup<T>
- Parameters:
row
- the row to be added
-
addStaticMemberRow
public void addStaticMemberRow(T row)
Description copied from interface:IRowGroup
Adds 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:
addStaticMemberRow
in interfaceIRowGroup<T>
- Parameters:
row
- the static row T to be added.
-
addMemberRows
public void addMemberRows(List<T> rows)
Description copied from interface:IRowGroup
Adds multiple rows into the group.
- Specified by:
addMemberRows
in interfaceIRowGroup<T>
- Parameters:
rows
- AList
of rows T to be added.
-
removeMemberRow
public boolean removeMemberRow(T row)
Description copied from interface:IRowGroup
Removes 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
IRowGroupModelListener
s to indicate a change in the model has occurred.- Specified by:
removeMemberRow
in interfaceIRowGroup<T>
- Parameters:
row
- The row T to be removed.- Returns:
- true if the row existed and was removed.
-
removeMemberRows
public void removeMemberRows(List<T> rows)
Description copied from interface:IRowGroup
Removes 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
IRowGroupModelListener
s to indicate a change in the model has occurred.- Specified by:
removeMemberRows
in interfaceIRowGroup<T>
- Parameters:
rows
- AList
of rows T to be added.
-
getParentGroup
public IRowGroup<T> getParentGroup()
Description copied from interface:IRowGroup
If this group is a nested child of another this will return the parent group.- Specified by:
getParentGroup
in interfaceIRowGroup<T>
- Returns:
- The parent group if this group is a nested child.
-
setParentGroup
public void setParentGroup(IRowGroup<T> parentGroup)
Description copied from interface:IRowGroup
Set the specified group as the parent of this group.- Specified by:
setParentGroup
in interfaceIRowGroup<T>
-
addRowGroup
public void addRowGroup(IRowGroup<T> rowGroup)
Description copied from interface:IRowGroup
Adds 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:
addRowGroup
in interfaceIRowGroup<T>
- Parameters:
rowGroup
- a IHierarchicalRowGroup.
-
removeRowGroup
public boolean removeRowGroup(IRowGroup<T> rowGroup)
Description copied from interface:IRowGroup
Returns the row-group child of this group.- Specified by:
removeRowGroup
in interfaceIRowGroup<T>
- Parameters:
rowGroup
- a IHierarchicalRowGroup.- Returns:
- true if the group existed as a child and was removed.
-
getRowGroups
public List<IRowGroup<T>> getRowGroups()
- Specified by:
getRowGroups
in interfaceIRowGroup<T>
- Returns:
- an unmodifiable
List
of the groups which are direct children of this group.
-
getOwnMemberRows
public List<T> getOwnMemberRows(boolean includeStaticRows)
Description copied from interface:IRowGroup
Returns only the rows contained with this group. Not nested groups.- Specified by:
getOwnMemberRows
in interfaceIRowGroup<T>
- Returns:
- a list of rows T.
-
getOwnStaticMemberRows
public List<T> getOwnStaticMemberRows()
- Specified by:
getOwnStaticMemberRows
in interfaceIRowGroup<T>
- Returns:
- Static rows only in this group not in nested groups.
-
clear
public void clear()
Description copied from interface:IRowGroup
Removes all member and static member rows from the group.
-
getMemberRows
public List<T> getMemberRows(boolean includeStaticRows)
- Specified by:
getMemberRows
in interfaceIRowGroup<T>
- Parameters:
includeStaticRows
- true to include the static rows false to exclude them.- Returns:
- an unmodifiable
List
of the rows (T) in theIRowGroup
.
-
getStaticMemberRows
public List<T> getStaticMemberRows()
- Specified by:
getStaticMemberRows
in interfaceIRowGroup<T>
- Returns:
- an unmodifiable
List
of the static rows (T) in theIRowGroup
.
-
getRowGroupForRow
public IRowGroup<T> getRowGroupForRow(T row)
Description copied from interface:IRowGroup
Retrieves the sub-group for a given row member.- Specified by:
getRowGroupForRow
in interfaceIRowGroup<T>
-
isEmpty
public boolean isEmpty()
-
-