public final class TableHelper extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
TableHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
adaptTo(IEnabledStateUpdating listener,
javax.swing.table.AbstractTableModel listModel)
Wires
listener to listModel in such a way, that
listener receives a IEnabledStateUpdating.updateEnabledState()
on every ListDataEvent. |
static void |
adaptTo(IEnabledStateUpdating listener,
javax.swing.ListSelectionModel listSelectionModel)
Wires
listener to listSelectionModel in such a way, that
listener receives a IEnabledStateUpdating.updateEnabledState()
on every ListSelectionEvent. |
static void |
adjustColumnWidth(javax.swing.JTable tbl,
int col,
boolean resizable)
adjust the preferred width of column col to the maximum preferred width of the cells (including header)
|
static void |
adjustColumnWidth(javax.swing.JTable tbl,
int col,
int maxColumnWidth)
adjust the preferred width of column col to the maximum preferred width of the cells (including header)
requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
|
static void |
computeColumnsWidth(javax.swing.JTable tbl)
adjust the table's columns to fit their content best
requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
|
(package private) static int |
getColumnHeaderWidth(javax.swing.JTable tbl,
int col) |
(package private) static int |
getMaxWidth(javax.swing.JTable tbl,
int col) |
static int[] |
getSelectedIndices(javax.swing.ListSelectionModel selectionModel)
Returns an array of all of the selected indices in the selection model, in increasing order.
|
private TableHelper()
public static void adaptTo(IEnabledStateUpdating listener, javax.swing.ListSelectionModel listSelectionModel)
listener to listSelectionModel in such a way, that
listener receives a IEnabledStateUpdating.updateEnabledState()
on every ListSelectionEvent.listener - the listenerlistSelectionModel - the source emitting ListSelectionEventspublic static void adaptTo(IEnabledStateUpdating listener, javax.swing.table.AbstractTableModel listModel)
listener to listModel in such a way, that
listener receives a IEnabledStateUpdating.updateEnabledState()
on every ListDataEvent.listener - the listenerlistModel - the source emitting ListDataEventsstatic int getColumnHeaderWidth(javax.swing.JTable tbl, int col)
static int getMaxWidth(javax.swing.JTable tbl, int col)
public static void adjustColumnWidth(javax.swing.JTable tbl, int col, boolean resizable)
tbl - tablecol - column indexresizable - if true, resizing is allowedpublic static void adjustColumnWidth(javax.swing.JTable tbl, int col, int maxColumnWidth)
tbl - tablecol - column indexmaxColumnWidth - maximum column widthpublic static void computeColumnsWidth(javax.swing.JTable tbl)
tbl - tablepublic static int[] getSelectedIndices(javax.swing.ListSelectionModel selectionModel)
selectionModel - list selection model.