Package org.jdesktop.swingx.table
Class ColumnControlButton.DefaultColumnControlPopup
- java.lang.Object
-
- org.jdesktop.swingx.table.ColumnControlButton.DefaultColumnControlPopup
-
- All Implemented Interfaces:
UIDependent
,ColumnControlPopup
,ColumnControlPopup.ActionGroupable
- Enclosing class:
- ColumnControlButton
public class ColumnControlButton.DefaultColumnControlPopup extends java.lang.Object implements ColumnControlPopup, ColumnControlPopup.ActionGroupable
A default implementation of ColumnControlPopup. It uses a JPopupMenu with MenuItems corresponding to the Actions as provided by the ColumnControlButton.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdesktop.swingx.table.ColumnControlPopup
ColumnControlPopup.ActionGroupable, ColumnControlPopup.ActionGrouper
-
-
Field Summary
Fields Modifier and Type Field Description private ColumnControlPopup.ActionGrouper
grouper
private javax.swing.JPopupMenu
popupMenu
-
Constructor Summary
Constructors Constructor Description DefaultColumnControlPopup()
DefaultColumnControlPopup(ColumnControlPopup.ActionGrouper grouper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalActionItems(java.util.List<? extends javax.swing.Action> actions)
Adds additional actions to the popup.protected void
addItem(javax.swing.JMenuItem item)
protected void
addItems(java.util.List<? extends javax.swing.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(java.util.List<? extends AbstractActionExt> actions)
Adds items corresponding to the column's visibility actions.void
applyComponentOrientation(java.awt.ComponentOrientation o)
Applies the specified component orientation to all internal widgets.protected ColumnControlPopup.ActionGrouper
getGrouper()
protected javax.swing.JPopupMenu
getPopupMenu()
void
removeAll()
Removes all items from the popup.void
setActionGrouper(ColumnControlPopup.ActionGrouper grouper)
void
toggleVisibility(javax.swing.JComponent owner)
Toggles the popup's visibility.void
updateUI()
Updates all internal visuals after changing a UI-delegate.
-
-
-
Field Detail
-
popupMenu
private javax.swing.JPopupMenu popupMenu
-
grouper
private ColumnControlPopup.ActionGrouper grouper
-
-
Constructor Detail
-
DefaultColumnControlPopup
public DefaultColumnControlPopup()
-
DefaultColumnControlPopup
public DefaultColumnControlPopup(ColumnControlPopup.ActionGrouper grouper)
-
-
Method Detail
-
updateUI
public void updateUI()
Description copied from interface:UIDependent
Updates all internal visuals after changing a UI-delegate.- Specified by:
updateUI
in interfaceUIDependent
- See Also:
JComponent.updateUI()
-
toggleVisibility
public void toggleVisibility(javax.swing.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 interfaceColumnControlPopup
- Parameters:
owner
- the JComponent which triggered the visibility change, typically a ColumnControlButton.
-
applyComponentOrientation
public void applyComponentOrientation(java.awt.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 interfaceColumnControlPopup
- Parameters:
o
- the componentOrientation to apply to all internal widgets.
-
removeAll
public void removeAll()
Description copied from interface:ColumnControlPopup
Removes all items from the popup.- Specified by:
removeAll
in interfaceColumnControlPopup
-
addVisibilityActionItems
public void addVisibilityActionItems(java.util.List<? extends AbstractActionExt> actions)
Description copied from interface:ColumnControlPopup
Adds items corresponding to the column's visibility actions.Each
Action
in the list is astateAction
, itsselected
property bound to a column'svisible
property, that is toggling the selected will toggle the column's visibility (if the action is enabled). TheAction
sname
property is bound to the column'stitle
.- Specified by:
addVisibilityActionItems
in interfaceColumnControlPopup
- Parameters:
actions
- List of AbstractActionExt to add.
-
addAdditionalActionItems
public void addAdditionalActionItems(java.util.List<? extends javax.swing.Action> actions)
Description copied from interface:ColumnControlPopup
Adds additional actions to the popup.- Specified by:
addAdditionalActionItems
in interfaceColumnControlPopup
- Parameters:
actions
- List ofAction
s to add to the popup.
-
addItems
protected void addItems(java.util.List<? extends javax.swing.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(javax.swing.JMenuItem item)
- Parameters:
item
- the menuItem to add to the popup.
-
getPopupMenu
protected javax.swing.JPopupMenu getPopupMenu()
- Returns:
- the popup to add menuitems. Guaranteed to be != null.
-
setActionGrouper
public void setActionGrouper(ColumnControlPopup.ActionGrouper grouper)
- Specified by:
setActionGrouper
in interfaceColumnControlPopup.ActionGroupable
-
getGrouper
protected ColumnControlPopup.ActionGrouper getGrouper()
-
-