Class TableSortState

java.lang.Object
docking.widgets.table.TableSortState
All Implemented Interfaces:
Iterable<ColumnSortState>

public class TableSortState extends Object implements Iterable<ColumnSortState>
Represents the concept of a table's sorted state, which is the number of sorted columns, their sort order and their sort direction. You can create instances of this class via the TableSortStateEditor.
  • Constructor Details

    • TableSortState

      public TableSortState()
    • TableSortState

      public TableSortState(List<ColumnSortState> sortStates)
    • TableSortState

      public TableSortState(ColumnSortState columnSortState)
  • Method Details

    • createUnsortedSortState

      public static TableSortState createUnsortedSortState()
      Creates a sort state that represents being unsorted
      Returns:
      a sort state that represents being unsorted
    • createDefaultSortState

      public static TableSortState createDefaultSortState(int columnIndex)
      Creates a sort state with the given column as the sorted column (sorted ascending).
      Parameters:
      columnIndex - The column to sort
      Returns:
      a sort state with the given column as the sorted column (sorted ascending).
      See Also:
    • createDefaultSortState

      public static TableSortState createDefaultSortState(int columnIndex, boolean isAscending)
      Creates a sort state with the given column as the sorted column in the given direction.
      Parameters:
      columnIndex - The column to sort
      isAscending - True to sort ascending; false to sort descending
      Returns:
      a sort state with the given column as the sorted column (sorted ascending).
      See Also:
    • iterator

      public Iterator<ColumnSortState> iterator()
      Specified by:
      iterator in interface Iterable<ColumnSortState>
    • getSortedColumnCount

      public int getSortedColumnCount()
    • isUnsorted

      public boolean isUnsorted()
    • getColumnSortState

      public ColumnSortState getColumnSortState(int columnIndex)
    • getAllSortStates

      public List<ColumnSortState> getAllSortStates()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • restoreFromXML

      public static TableSortState restoreFromXML(org.jdom.Element element)
    • writeToXML

      public org.jdom.Element writeToXML()
    • toString

      public String toString()
      Overrides:
      toString in class Object