Package docking.widgets.table
Class TableSortState
- java.lang.Object
-
- docking.widgets.table.TableSortState
-
- All Implemented Interfaces:
java.lang.Iterable<ColumnSortState>
public class TableSortState extends java.lang.Object implements java.lang.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 theTableSortStateEditor
.
-
-
Constructor Summary
Constructors Constructor Description TableSortState()
TableSortState(ColumnSortState columnSortState)
TableSortState(java.util.List<ColumnSortState> sortStates)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TableSortState
createDefaultSortState(int columnIndex)
Creates a sort state with the given column as the sorted column (sorted ascending).static TableSortState
createDefaultSortState(int columnIndex, boolean isAscending)
Creates a sort state with the given column as the sorted column in the given direction.static TableSortState
createUnsortedSortState()
Creates a sort state that represents being unsortedboolean
equals(java.lang.Object obj)
java.util.List<ColumnSortState>
getAllSortStates()
ColumnSortState
getColumnSortState(int columnIndex)
int
getSortedColumnCount()
int
hashCode()
boolean
isUnsorted()
java.util.Iterator<ColumnSortState>
iterator()
static TableSortState
restoreFromXML(org.jdom.Element element)
java.lang.String
toString()
org.jdom.Element
writeToXML()
-
-
-
Constructor Detail
-
TableSortState
public TableSortState()
-
TableSortState
public TableSortState(java.util.List<ColumnSortState> sortStates)
-
TableSortState
public TableSortState(ColumnSortState columnSortState)
-
-
Method Detail
-
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:
TableSortStateEditor
-
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 sortisAscending
- True to sort ascending; false to sort descending- Returns:
- a sort state with the given column as the sorted column (sorted ascending).
- See Also:
TableSortStateEditor
-
iterator
public java.util.Iterator<ColumnSortState> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<ColumnSortState>
-
getSortedColumnCount
public int getSortedColumnCount()
-
isUnsorted
public boolean isUnsorted()
-
getColumnSortState
public ColumnSortState getColumnSortState(int columnIndex)
-
getAllSortStates
public java.util.List<ColumnSortState> getAllSortStates()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
restoreFromXML
public static TableSortState restoreFromXML(org.jdom.Element element)
-
writeToXML
public org.jdom.Element writeToXML()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-