Package org.compiere.swing
Class CColumnControlButton.ColumnVisibilityAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jdesktop.swingx.action.AbstractActionExt
-
- org.compiere.swing.CColumnControlButton.ColumnVisibilityAction
-
- All Implemented Interfaces:
ActionListener,ItemListener,Serializable,Cloneable,EventListener,Action
- Enclosing class:
- CColumnControlButton
public class CColumnControlButton.ColumnVisibilityAction extends org.jdesktop.swingx.action.AbstractActionExtA specializedActionwhich takes care of keeping in synch with TableColumn state. NOTE: client must call releaseColumn if this action is no longer needed!- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jdesktop.swingx.action.AbstractActionExt
GROUP, IS_STATE, LARGE_ICON
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
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
Constructors Constructor Description ColumnVisibilityAction(TableColumn column)Creates a action synched to the table column.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent e)Does nothing.protected PropertyChangeListenercreatePropertyChangeListener()Creates and returns the listener to column's property changes.protected PropertyChangeListenergetColumnListener()Returns the listener to column's property changes.voiditemStateChanged(ItemEvent e)voidreleaseColumn()Releases all references to the synchedTableColumn.voidsetSelected(boolean newValue)-
Methods 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, toString
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
ColumnVisibilityAction
public ColumnVisibilityAction(TableColumn column)
Creates a action synched to the table column.- Parameters:
column- theTableColumnto keep synched to.
-
-
Method Detail
-
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.
-
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classorg.jdesktop.swingx.action.AbstractActionExt
-
setSelected
public void setSelected(boolean newValue)
- Overrides:
setSelectedin classorg.jdesktop.swingx.action.AbstractActionExt
-
actionPerformed
public void actionPerformed(ActionEvent e)
Does nothing. Synch from action state to TableColumn state is done in itemStateChanged.
-
getColumnListener
protected PropertyChangeListener 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
protected PropertyChangeListener 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
-
-