Package org.jdesktop.swingx.table
Class ColumnControlButton.ColumnVisibilityAction
java.lang.Object
javax.swing.AbstractAction
org.jdesktop.swingx.action.AbstractActionExt
org.jdesktop.swingx.table.ColumnControlButton.ColumnVisibilityAction
- All Implemented Interfaces:
ActionListener,ItemListener,Serializable,Cloneable,EventListener,Action
- Enclosing class:
- ColumnControlButton
A specialized
Action which takes care of keeping in synch with
TableColumn state.
NOTE: client must call releaseColumn if this action is no longer needed!- See Also:
-
Field Summary
Fields inherited from class org.jdesktop.swingx.action.AbstractActionExt
GROUP, IS_STATE, LARGE_ICONFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsConstructorDescriptionColumnVisibilityAction(TableColumn column) Creates a action synched to the table column. -
Method Summary
Modifier and TypeMethodDescriptionvoidDoes nothing.protected booleanReturns flag to indicate if column's visibility can be controlled.protected PropertyChangeListenerCreates and returns the listener to column's property changes.protected PropertyChangeListenerReturns the listener to column's property changes.booleanReturns true if the action is enabled.voidvoidReleases all references to the synchedTableColumn.voidsetSelected(boolean newValue) protected voidupdateFromColumnHideable(boolean hideable) TODO docMethods inherited from class org.jdesktop.swingx.action.AbstractActionExt
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setShortDescription, setSmallIcon, setStateAction, setStateAction, toStringMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
ColumnVisibilityAction
Creates a action synched to the table column.- Parameters:
column- theTableColumnto keep synched to.
-
-
Method Details
-
releaseColumn
public void releaseColumn()Releases all references to the synchedTableColumn. Client code must call this method if the action is no longer needed. After calling this action must not be used any longer. -
isEnabled
public boolean isEnabled()Returns true if the action is enabled. Returns true only if the action is enabled and the table column can be controlled.- Specified by:
isEnabledin interfaceAction- Overrides:
isEnabledin classAbstractAction- Returns:
- true if the action is enabled, false otherwise
- See Also:
-
canControlColumn
protected boolean canControlColumn()Returns flag to indicate if column's visibility can be controlled. Minimal requirement is that column is of typeTableColumnExt.- Returns:
- boolean to indicate if columns's visibility can be controlled.
-
itemStateChanged
- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classAbstractActionExt
-
setSelected
public void setSelected(boolean newValue) - Overrides:
setSelectedin classAbstractActionExt
-
actionPerformed
Does nothing. Synch from action state to TableColumn state is done in itemStateChanged. -
updateFromColumnHideable
protected void updateFromColumnHideable(boolean hideable) TODO doc- Parameters:
hideable- boolean
-
getColumnListener
Returns the listener to column's property changes. The listener is created lazily if necessary.- Returns:
- the
PropertyChangeListenerlistening toTableColumn's property changes, guaranteed to be notnull.
-
createPropertyChangeListener
Creates and returns the listener to column's property changes. Subclasses are free to roll their own.Implementation note: this listener reacts to column's
visibleandheaderValueproperties and calls the respectiveupdateFromXXmethodes.- Returns:
- the
PropertyChangeListenerto use with the column
-