Package docking.widgets.table
Class TableUtils
- java.lang.Object
-
- docking.widgets.table.TableUtils
-
public class TableUtils extends java.lang.Object
A utility class for JTables used in Ghidra.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_SEARCH_ROWS
-
Constructor Summary
Constructors Constructor Description TableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
columnAlternativelySelected(javax.swing.JTable table, int columnIndex)
Attempts to sort the given table based upon the given column index.static void
columnSelected(javax.swing.JTable table, int columnIndex)
Attempts to sort the given table based upon the given column index.
-
-
-
Field Detail
-
MAX_SEARCH_ROWS
public static final int MAX_SEARCH_ROWS
- See Also:
- Constant Field Values
-
-
Method Detail
-
columnSelected
public static void columnSelected(javax.swing.JTable table, int columnIndex)
Attempts to sort the given table based upon the given column index. If theTableModel
of the given table is not aSortedTableModel
, then this method will do nothing.If the given column index is not sortable, then this method will not change the state of the model. Otherwise, the sorted model will be sorted on the given column index. The results of calling this method depend upon the current sorted state of the given column:
- if the column is not yet the sorted column, then the column is made the sorted column, if sortable, and any other sorted columns will be made unsorted, or
- if the column is the sorted column and the direction will simply be toggled.
- Parameters:
table
- The table whose model shall be sorted.columnIndex
- The column index upon which to sort.
-
columnAlternativelySelected
public static void columnAlternativelySelected(javax.swing.JTable table, int columnIndex)
Attempts to sort the given table based upon the given column index. If theTableModel
of the given table is not aSortedTableModel
, then this method will do nothing.If the given column index is not sortable, then this method will not change the state of the model. The results of calling this method depend upon the current sorted state of the given column:
- if the column is not yet sorted, then the column is made sorted, if sortable, and any other sorted columns will not be changed, or
- if the column is sorted, then:
- if there are other sorted columns, this column will no longer be sorted
- if there are no other sorted columns, then no action will be taken
- Parameters:
table
- The table whose model shall be sorted.columnIndex
- The column index upon which to sort.
-
-