|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
de.mguennewig.pobjsearch.ToggleColumnAction
public final class ToggleColumnAction
Action to toggle the visibility of a table column.
The visibility is toggled by removing/adding it from/to the table column model.
This action is enabled by default unless it is
associated to the last visible column to prevent the table header to become
invisible.
Instances of this action are only serializable if the column model and the column name instance are serializable. In most cases this should be the case as the column name object is normally a string and the default column model is serializable.
| Field Summary |
|---|
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
ToggleColumnAction(int modelIndex,
javax.swing.table.TableColumnModel model,
java.lang.Object columnName)
Creates a new toggle column action. |
|
ToggleColumnAction(javax.swing.table.TableModel tableModel,
int modelIndex,
javax.swing.table.TableColumnModel model)
Creates a new toggle column action. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
static int |
getColumnIndex(javax.swing.table.TableColumnModel columnModel,
java.lang.Object columnName)
A simple wrapper around TableColumnModel.getColumnIndex(Object) to
catch the stupid exception and return -1 instead. |
static boolean |
isColumnVisible(javax.swing.table.TableColumnModel columnModel,
java.lang.Object columnName)
Tests whether a named column exists in the column model. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ToggleColumnAction(int modelIndex,
javax.swing.table.TableColumnModel model,
java.lang.Object columnName)
modelIndex - Index of the column within the TableModel used
by the table whose column model we modify.model - The column model which should be manipulated.columnName - The name of the column whose visibility should be
toggled.
public ToggleColumnAction(javax.swing.table.TableModel tableModel,
int modelIndex,
javax.swing.table.TableColumnModel model)
tableModel - The table model.modelIndex - Index of the column within the TableModel used
by the table whose column model we modify.model - The column model which should be manipulated.| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent event)
public static int getColumnIndex(javax.swing.table.TableColumnModel columnModel,
java.lang.Object columnName)
TableColumnModel.getColumnIndex(Object) to
catch the stupid exception and return -1 instead.
public static boolean isColumnVisible(javax.swing.table.TableColumnModel columnModel,
java.lang.Object columnName)
getColumnIndex(TableColumnModel,Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||