org.jdesktop.swingx.table
Class ColumnControlButton.DefaultColumnControlPopup

java.lang.Object
  extended by org.jdesktop.swingx.table.ColumnControlButton.DefaultColumnControlPopup
All Implemented Interfaces:
ColumnControlPopup
Enclosing class:
ColumnControlButton

public class ColumnControlButton.DefaultColumnControlPopup
extends Object
implements ColumnControlPopup

A default implementation of ColumnControlPopup. It uses a JPopupMenu with MenuItems corresponding to the Actions as provided by the ColumnControlButton.


Constructor Summary
ColumnControlButton.DefaultColumnControlPopup()
           
 
Method Summary
 void addAdditionalActionItems(List<? extends Action> actions)
          Adds additional actions to the popup.
protected  void addItem(JMenuItem item)
           
protected  void addItems(List<? extends Action> actions)
          Here: creates and adds a menuItem to the popup for every Action in the list.
protected  void addSeparator()
          adds a separator to the popup.
 void addVisibilityActionItems(List<? extends AbstractActionExt> actions)
          Adds items corresponding to the column's visibility actions.
 void applyComponentOrientation(ComponentOrientation o)
          Applies the specified component orientation to all internal widgets.
protected  JPopupMenu getPopupMenu()
           
 void removeAll()
          Removes all items from the popup.
 void toggleVisibility(JComponent owner)
          Toggles the popup's visibility.
 void updateUI()
          Updates all internal visuals after changing a UI-delegate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnControlButton.DefaultColumnControlPopup

public ColumnControlButton.DefaultColumnControlPopup()
Method Detail

updateUI

public void updateUI()
Description copied from interface: ColumnControlPopup
Updates all internal visuals after changing a UI-delegate.

The method called by ColumnControlButton in it's updateUI. As there is a good probability that at the time of a ColumnControlButton is updated after a ui-delegate change the popup is not visible/part of the container hierarchy, this method must be messaged manually.

Specified by:
updateUI in interface ColumnControlPopup
See Also:
JComponent.updateUI()

toggleVisibility

public void toggleVisibility(JComponent owner)
Description copied from interface: ColumnControlPopup
Toggles the popup's visibility. This method is responsible for placing itself relative to the given owner if toggled to visible.

Specified by:
toggleVisibility in interface ColumnControlPopup
Parameters:
owner - the JComponent which triggered the visibility change, typically a ColumnControlButton.

applyComponentOrientation

public void applyComponentOrientation(ComponentOrientation o)
Description copied from interface: ColumnControlPopup
Applies the specified component orientation to all internal widgets. This method must be called by the owner if its component orientation changes.

Specified by:
applyComponentOrientation in interface ColumnControlPopup
Parameters:
o - the componentOrientation to apply to all internal widgets.
See Also:
Container.applyComponentOrientation(ComponentOrientation).

removeAll

public void removeAll()
Description copied from interface: ColumnControlPopup
Removes all items from the popup.

Specified by:
removeAll in interface ColumnControlPopup

addVisibilityActionItems

public void addVisibilityActionItems(List<? extends AbstractActionExt> actions)
Description copied from interface: ColumnControlPopup
Adds items corresponding to the column's visibility actions.

Each Action in the list is a stateAction, its selected property bound to a column's visible property, that is toggling the selected will toggle the column's visibility (if the action is enabled). The Actions name property is bound to the column's title.

Specified by:
addVisibilityActionItems in interface ColumnControlPopup
Parameters:
actions - List of AbstractActionExt to add.

addAdditionalActionItems

public void addAdditionalActionItems(List<? extends Action> actions)
Description copied from interface: ColumnControlPopup
Adds additional actions to the popup.

Specified by:
addAdditionalActionItems in interface ColumnControlPopup
Parameters:
actions - List of Actions to add to the popup.

addItems

protected void addItems(List<? extends Action> actions)
Here: creates and adds a menuItem to the popup for every Action in the list. Does nothing if if the list is empty. PRE: actions != null.

Parameters:
actions - a list containing the actions to add to the popup. Must not be null.

addSeparator

protected void addSeparator()
adds a separator to the popup.


addItem

protected void addItem(JMenuItem item)
Parameters:
item - the menuItem to add to the popup.

getPopupMenu

protected JPopupMenu getPopupMenu()
Returns:
the popup to add menuitems. Guaranteed to be != null.