Issue Details (XML | Word | Printable)

Key: SWINGX-968
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: kleopatra
Reporter: arkadi
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Enhance ColumnControlButton popup with separator

Created: 17/Dec/08 04:39 AM   Updated: 19/Aug/11 01:24 PM   Resolved: 19/Aug/11 01:24 PM
Component/s: Table
Affects Version/s: 0.9.0
Fix Version/s: 1.6.3

Time Tracking:
Not Specified

File Attachments: None
Image Attachments:

1. dummy-menu-separator.png
(9 kB)

Operating System: All
Platform: All

Issuezilla Id: 968
Participants: arkadi and kleopatra

 Description  « Hide

We use the following code to add custom JXTable actions that can be invoked by user when
ColumnControlButton is clicked:

JXTable.getActionMap().put(ColumnControlButton.COLUMN_CONTROL_MARKER + "x1_sorted_by",
new AbstractAction("Action") {
public void actionPerformed(ActionEvent e) { ... }

Is it possible to enhance the popup to:
1. Sort custom actions independently and always place them after standard table actions?
2. Create a separator after standard actions to visually delimit custom application
actions? Like a separator that is already there after column list and 'Horizontal scroll'

kleopatra added a comment - 17/Dec/08 05:25 AM

you'll have to implement a custom columnControlButton which does what you want
it to do. Probably need a custom marker for those additional actions, then
override addAdditionalActions to add those below the standard ones. Hmm ... just
checked: the DefaultColumnControlPopup inserts the separator between the column
visible actions and the rest. So need some additional marker for a custom
separator (the "usual" hack is to use a null - always thought that a bit weak,
but might be a way out for now?)

Please let me know how it goes (always interested, even if postponing this to
after final


arkadi added a comment - 17/Dec/08 07:13 AM

Thats too much of work for the buck
I hope this will be properly implemented in SwingX someday, because current behavior has usability
For now the solution is:
JXTable.getActionMap().put(ColumnControlButton.COLUMN_CONTROL_MARKER +
new AbstractAction("---") {
public void actionPerformed(ActionEvent e) {
public boolean isEnabled() { return false; }

arkadi added a comment - 17/Dec/08 07:14 AM

Created an attachment (id=267)
How it should looks like

kleopatra added a comment - 17/Dec/08 07:56 AM

oooo ... how creative

Definitely need something better


kleopatra added a comment - 19/Aug/11 01:23 PM

added api to plug-in a "ActionGrouper" (aka: client code supplied class to group the actions), the default popup adds separators between the groups as returned by the grouper

  • added interface ActionGrouper
  • added interface ActionGroupable and implement in DefaultColumnControlPopup
  • added delegate setter of ActionGroupable to ColumnControlButton
  • added tests
  • added example for custom grouper to ColumnControlButtonVisualCheck

kleopatra added a comment - 19/Aug/11 01:24 PM

fixed of revision #4064