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
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAllGroupByColumnIndexes
(int... columnIndexes) Add the given column indexes to the list of column indexes that are currently grouped.boolean
addGroupByColumnIndex
(int columnIndex) Add the given column index to the list of column indexes that are currently grouped.void
Clear the local list of indexes of columns that are currently grouped.void
loadState
(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.boolean
removeAllGroupByColumnIndexes
(int... columnIndexes) Remove the given column indexes from the list of column indexes that are currently grouped.boolean
removeGroupByColumnIndex
(int columnIndex) Remove the given column index from the list of column indexes that are currently grouped.void
saveState
(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.void
setGroupByColumnIndexes
(int... columnIndexes) Set the given column indexes to the list of column indexes that are currently grouped.void
update()
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:
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
- Returns:
- The indexes of the columns that are currently grouped.
-
saveState
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 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: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 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.
-