public class ColumnControlButton.ColumnVisibilityAction extends AbstractActionExt
Action which takes care of keeping in synch with
TableColumn state.
NOTE: client must call releaseColumn if this action is no longer needed!GROUP, IS_STATE, LARGE_ICONchangeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
ColumnVisibilityAction(TableColumn column)
Creates a action synched to the table column.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Does nothing.
|
protected boolean |
canControlColumn()
Returns flag to indicate if column's visibility can
be controlled.
|
protected PropertyChangeListener |
createPropertyChangeListener()
Creates and returns the listener to column's property changes.
|
protected PropertyChangeListener |
getColumnListener()
Returns the listener to column's property changes.
|
boolean |
isEnabled()
Returns true if the action is enabled.
|
void |
itemStateChanged(ItemEvent e)
Callback method as
ItemListener. |
void |
releaseColumn()
Releases all references to the synched
TableColumn. |
void |
setSelected(boolean newValue)
Changes the state of the action.
|
protected void |
updateFromColumnHideable(boolean hideable) |
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setShortDescription, setSmallIcon, setStateAction, setStateAction, toStringaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabledpublic ColumnVisibilityAction(TableColumn column)
column - the TableColumn to keep synched to.public void releaseColumn()
TableColumn.
Client code must call this method if the
action is no longer needed. After calling this action must not be
used any longer.public boolean isEnabled()
isEnabled in interface ActionisEnabled in class AbstractActioncanControlColumn()protected boolean canControlColumn()
TableColumnExt.public void itemStateChanged(ItemEvent e)
AbstractActionExtItemListener. Updates internal state based
on the given ItemEvent. Here: synchs selected property if isStateAction(), does nothing otherwise.
itemStateChanged in interface ItemListeneritemStateChanged in class AbstractActionExte - the ItemEvent fired by a ItemSelectable on changing the selected
state.public void setSelected(boolean newValue)
AbstractActionExtsetSelected in class AbstractActionExtnewValue - true to set the action as selected of the action.Action.SELECTED_KEYpublic void actionPerformed(ActionEvent e)
protected void updateFromColumnHideable(boolean hideable)
protected PropertyChangeListener getColumnListener()
PropertyChangeListener listening to
TableColumn's property changes, guaranteed to be
not null.protected PropertyChangeListener createPropertyChangeListener()
Implementation note: this listener reacts to column's
visible and headerValue properties and
calls the respective updateFromXX methodes.
PropertyChangeListener to use with the
columnCopyright © 2017. All Rights Reserved.