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 TableSortStatecreateDefaultSortState(int columnIndex)Creates a sort state with the given column as the sorted column (sorted ascending).static TableSortStatecreateDefaultSortState(int columnIndex, boolean isAscending)Creates a sort state with the given column as the sorted column in the given direction.static TableSortStatecreateUnsortedSortState()Creates a sort state that represents being unsortedbooleanequals(java.lang.Object obj)java.util.List<ColumnSortState>getAllSortStates()ColumnSortStategetColumnSortState(int columnIndex)intgetSortedColumnCount()inthashCode()booleanisUnsorted()java.util.Iterator<ColumnSortState>iterator()static TableSortStaterestoreFromXML(org.jdom.Element element)java.lang.StringtoString()org.jdom.ElementwriteToXML()
-
-
-
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:
iteratorin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
toStringin classjava.lang.Object
-
-