Interface IRowGroup<T>

Type Parameters:
T - the type of the row objects.
All Known Implementing Classes:
RowGroup

public interface IRowGroup<T>
Represents a collapseable group of rows (of type T) in the IRowGroupModel.
Author:
Stefan Bolton
  • Method Details

    • getGroupName

      String getGroupName()
      Returns:
      A Unique name for the group - it must not conflict with any other group's name.
    • getParentGroup

      IRowGroup<T> getParentGroup()
      If this group is a nested child of another this will return the parent group.
      Returns:
      The parent group if this group is a nested child.
    • setParentGroup

      void setParentGroup(IRowGroup<T> parentGroup)
      Set the specified group as the parent of this group.
      Parameters:
      parentGroup -
    • isCollapsed

      boolean isCollapsed()
      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

      boolean isCollapseable()
      Returns:
      Whether the group can be expanded or collapsed or, false if it should be locked in it's current state.
    • collapse

      void collapse()

      Updates 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

      void expand()

      Updates 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

      void addMemberRow(T row)

      Adds the row into the group.

      Parameters:
      row - the row to be added
    • addMemberRows

      void addMemberRows(List<T> rows)

      Adds multiple rows into the group.

      Parameters:
      rows - A List of rows T to be added.
    • addStaticMemberRow

      void addStaticMemberRow(T row)

      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).

      Parameters:
      row - the static row T to be added.
    • removeMemberRow

      boolean removeMemberRow(T row)

      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 IRowGroupModelListeners to indicate a change in the model has occurred.

      Parameters:
      row - The row T to be removed.
      Returns:
      true if the row existed and was removed.
    • removeMemberRows

      void removeMemberRows(List<T> rows)

      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 IRowGroupModelListeners to indicate a change in the model has occurred.

      Parameters:
      rows - A List of rows T to be added.
    • getMemberRows

      List<T> getMemberRows(boolean includeStaticRows)
      Parameters:
      includeStaticRows - true to include the static rows false to exclude them.
      Returns:
      an unmodifiable List of the rows (T) in the IRowGroup.
    • getStaticMemberRows

      List<T> getStaticMemberRows()
      Returns:
      an unmodifiable List of the static rows (T) in the IRowGroup.
    • clear

      void clear()
      Removes all member and static member rows from the group.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if there are no rows (normal or static) in the group.
    • addRowGroup

      void addRowGroup(IRowGroup<T> rowGroup)
      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.
      Parameters:
      rowGroup - a IHierarchicalRowGroup.
    • removeRowGroup

      boolean removeRowGroup(IRowGroup<T> rowGroup)
      Returns the row-group child of this group.
      Parameters:
      rowGroup - a IHierarchicalRowGroup.
      Returns:
      true if the group existed as a child and was removed.
    • getRowGroups

      List<IRowGroup<T>> getRowGroups()
      Returns:
      an unmodifiable List of the groups which are direct children of this group.
    • getOwnMemberRows

      List<T> getOwnMemberRows(boolean includeStaticRows)
      Returns only the rows contained with this group. Not nested groups.
      Returns:
      a list of rows T.
    • getOwnStaticMemberRows

      List<T> getOwnStaticMemberRows()
      Returns:
      Static rows only in this group not in nested groups.
    • getRowGroupForRow

      IRowGroup<T> getRowGroupForRow(T row)
      Retrieves the sub-group for a given row member.
    • setData

      void setData(Object data)
      Allows some arbitrary data to be tagged to an IRowGroup.
      Parameters:
      data -
    • setData

      void setData(String key, Object data)
      Allows some arbitrary data to be tagged to an IRowGroup.
      Parameters:
      data -
    • getData

      Object getData()
      Allows some arbitrary data to be retrieved from an IRowGroup.
    • getData

      Object getData(String key)
      Allows some arbitrary data to be retrieved from an IRowGroup.