Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:
  java.awt.event.ActionListener, java.awt.event.ItemListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

Enclosing class:
  ColumnControlButton

    public class ColumnControlButton.ColumnVisibilityAction

extends AbstractActionExt

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:
  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
`ColumnControlButton.ColumnVisibilityAction(javax.swing.table.TableColumn column)` Creates a action synched to the table column.

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent e)` Does nothing.
`protected boolean` | `canControlColumn()` Returns flag to indicate if column's visibility can be controlled.
`protected java.beans.PropertyChangeListener` | `createPropertyChangeListener()` Creates and returns the listener to column's property changes.
`protected java.beans.PropertyChangeListener` | `getColumnListener()` Returns the listener to column's property changes.
`boolean` | `isEnabled()` Returns true if the action is enabled.
`void` | `itemStateChanged(java.awt.event.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

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, putValue, removePropertyChangeListener, setEnabled`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ColumnControlButton.ColumnVisibilityAction

    public ColumnControlButton.ColumnVisibilityAction(javax.swing.table.TableColumn column)

  Creates a action synched to the table column.

  Parameters:
    `column` - the `TableColumn` to keep synched to.

Method Detail

### releaseColumn

    public void releaseColumn()

  Releases all references to the synched `TableColumn`. 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:
    `isEnabled` in interface `javax.swing.Action`
  Overrides:
    `isEnabled` in class `javax.swing.AbstractAction`
  Returns:
    true if the action is enabled, false otherwise
  See Also:
    `canControlColumn()`

### canControlColumn

    protected boolean canControlColumn()

  Returns flag to indicate if column's visibility can be controlled. Minimal requirement is that column is of type `TableColumnExt`.

  Returns:
    boolean to indicate if columns's visibility can be controlled.

### itemStateChanged

    public void itemStateChanged(java.awt.event.ItemEvent e)

  Description copied from class: `AbstractActionExt`
  Callback method as `ItemListener`. Updates internal state based on the given ItemEvent.

  Here: synchs selected property if isStateAction(), does nothing otherwise.

  Specified by:
    `itemStateChanged` in interface `java.awt.event.ItemListener`
  Overrides:
    `itemStateChanged` in class `AbstractActionExt`
  Parameters:
    `e` - the ItemEvent fired by a ItemSelectable on changing the selected state.

### setSelected

    public void setSelected(boolean newValue)

  Description copied from class: `AbstractActionExt`
  Changes the state of the action

  Overrides:
    `setSelected` in class `AbstractActionExt`
  Parameters:
    `newValue` - true to set the action as selected of the action.

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)

  Does nothing. Synch from action state to TableColumn state is done in itemStateChanged.

### getColumnListener

    protected java.beans.PropertyChangeListener getColumnListener()

  Returns the listener to column's property changes. The listener is created lazily if necessary.

  Returns:
    the `PropertyChangeListener` listening to `TableColumn`'s property changes, guaranteed to be not `null`.

### createPropertyChangeListener

    protected java.beans.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 `visible` and `headerValue` properties and calls the respective `updateFromXX` methodes.

  Returns:
    the `PropertyChangeListener` to use with the column

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.