java.lang.Object
java.util.Observable
org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByModel
All Implemented Interfaces:
IPersistable

public class GroupByModel extends Observable implements IPersistable
The model that is used to internally store the groupby state. It is used to define the tree structure.
  • Field Details

    • PERSISTENCE_KEY_GROUP_BY_COLUMN_INDEXES

      public static final String PERSISTENCE_KEY_GROUP_BY_COLUMN_INDEXES
      See Also:
  • Constructor Details

    • GroupByModel

      public GroupByModel()
  • Method Details

    • addGroupByColumnIndex

      public boolean addGroupByColumnIndex(int columnIndex)
      Add the given column index to the list of column indexes that are currently grouped.
      Parameters:
      columnIndex - The column index to add to the grouping.
      Returns:
      true if the list did not already contain the given column index, false if the list is unchanged.
    • addAllGroupByColumnIndexes

      public boolean addAllGroupByColumnIndexes(int... columnIndexes)
      Add the given column indexes to the list of column indexes that are currently grouped.
      Parameters:
      columnIndexes - The column indexes to add to the grouping.
      Returns:
      true if the list did not already contain any of the given column indexes, false if the list is unchanged.
      Since:
      2.4
    • setGroupByColumnIndexes

      public void setGroupByColumnIndexes(int... columnIndexes)
      Set the given column indexes to the list of column indexes that are currently grouped. Simply overrides the existing grouping, and therefore always triggers an update.
      Parameters:
      columnIndexes - The column indexes to add to the grouping.
      Since:
      2.4
    • removeGroupByColumnIndex

      public boolean removeGroupByColumnIndex(int columnIndex)
      Remove the given column index from the list of column indexes that are currently grouped.
      Parameters:
      columnIndex - The column index to remove from the grouping.
      Returns:
      true if the list contained the element and was therefore changed, false if the list is unchanged.
    • removeAllGroupByColumnIndexes

      public boolean removeAllGroupByColumnIndexes(int... columnIndexes)
      Remove the given column indexes from the list of column indexes that are currently grouped.
      Parameters:
      columnIndexes - The column indexes to remove from the grouping.
      Returns:
      true if the list contained any of the elements and was therefore changed, false if the list is unchanged.
      Since:
      2.4
    • clearGroupByColumnIndexes

      public void clearGroupByColumnIndexes()
      Clear the local list of indexes of columns that are currently grouped. This means to perform a complete ungrouping.
    • getGroupByColumnIndexes

      public List<Integer> getGroupByColumnIndexes()
      Returns:
      The indexes of the columns that are currently grouped.
    • saveState

      public void saveState(String prefix, Properties properties)
      Description copied from interface: IPersistable
      Saves the state to the given Properties using the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.
      Specified by:
      saveState in interface IPersistable
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to save the state to.
    • loadState

      public void loadState(String prefix, Properties properties)
      Description copied from interface: IPersistable
      Restore the state out of the given Properties identified by the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.
      Specified by:
      loadState in interface IPersistable
      Parameters:
      prefix - The prefix to use for the state keys. Is also used as the state configuration name.
      properties - The Properties instance to load the state from.
    • update

      public void update()
      Notifies the observers about a change.
      See Also: