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 the ISortModel.
  • Field Details

  • Constructor Details

    • SortStatePersistor

      public SortStatePersistor(ISortModel sortModel)
  • Method Details

    • 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 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)
      Parses the saved string and restores the state to the ISortModel.
      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.
    • getSortStateFromString

      protected SortStatePersistor<T>.SortState getSortStateFromString(String token)
      Parse the string representation to extract the column index, sort direction and sort order