Class SortStatePersistor<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.sort.SortStatePersistor<T>
-
- Type Parameters:
T
- Type of the Beans in the backing data source.
- All Implemented Interfaces:
IPersistable
public class SortStatePersistor<T> extends Object implements IPersistable
Handles persisting of the sorting state. The sorting state is read from and restored to theISortModel
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SortStatePersistor.SortState
Encapsulation of the sort state of a column
-
Field Summary
Fields Modifier and Type Field Description static String
PERSISTENCE_KEY_SORTING_STATE
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description SortStatePersistor(ISortModel sortModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SortStatePersistor.SortState
getSortStateFromString(String token)
Parse the string representation to extract the column index, sort direction and sort ordervoid
loadState(String prefix, Properties properties)
Parses the saved string and restores the state to theISortModel
.void
saveState(String prefix, Properties properties)
Save the sorting state in the properties file.
-
-
-
Field Detail
-
PERSISTENCE_KEY_SORTING_STATE
public static final String PERSISTENCE_KEY_SORTING_STATE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SortStatePersistor
public SortStatePersistor(ISortModel sortModel)
-
-
Method Detail
-
saveState
public void saveState(String prefix, Properties properties)
Save the sorting state in the properties file.Key:
PERSISTENCE_KEY_SORTING_STATE
Format: column index : sort direction : sort order |
- 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
public void loadState(String prefix, Properties properties)
Parses the saved string and restores the state to theISortModel
.- 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.
-
getSortStateFromString
protected SortStatePersistor.SortState getSortStateFromString(String token)
Parse the string representation to extract the column index, sort direction and sort order
-
-