Class GroupByModel
java.lang.Object
java.util.Observable
org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByModel
- All Implemented Interfaces:
IPersistable
The model that is used to internally store the groupby state. It is used to
define the tree structure.
-
Field Summary
FieldsFields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAllGroupByColumnIndexes(int... columnIndexes) Add the given column indexes to the list of column indexes that are currently grouped.booleanaddGroupByColumnIndex(int columnIndex) Add the given column index to the list of column indexes that are currently grouped.voidClear the local list of indexes of columns that are currently grouped.voidloadState(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.booleanremoveAllGroupByColumnIndexes(int... columnIndexes) Remove the given column indexes from the list of column indexes that are currently grouped.booleanremoveGroupByColumnIndex(int columnIndex) Remove the given column index from the list of column indexes that are currently grouped.voidsaveState(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.voidsetGroupByColumnIndexes(int... columnIndexes) Set the given column indexes to the list of column indexes that are currently grouped.voidupdate()Notifies the observers about a change.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
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:
trueif the list did not already contain the given column index,falseif 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:
trueif the list did not already contain any of the given column indexes,falseif 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:
trueif the list contained the element and was therefore changed,falseif 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:
trueif the list contained any of the elements and was therefore changed,falseif 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
- Returns:
- The indexes of the columns that are currently grouped.
-
saveState
Description copied from interface:IPersistableSaves 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:
saveStatein interfaceIPersistable- 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
Description copied from interface:IPersistableRestore 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:
loadStatein interfaceIPersistable- 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.
-