swingx
  1. swingx
  2. SWINGX-968

Enhance ColumnControlButton popup with separator

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 1.6.3
    • Component/s: Table
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      968

      Description

      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'
      action.

        Activity

        Hide
        kleopatra added a comment -

        fixed of revision #4064

        Show
        kleopatra added a comment - fixed of revision #4064
        Hide
        kleopatra added a comment -

        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
        Show
        kleopatra added a comment - 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
        Hide
        kleopatra added a comment -

        oooo ... how creative

        Definitely need something better

        Jeanette

        Show
        kleopatra added a comment - oooo ... how creative Definitely need something better Jeanette
        Hide
        arkadi added a comment -

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

        Show
        arkadi added a comment - Created an attachment (id=267) How it should looks like
        Hide
        arkadi added a comment -

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

        { return false; }

        });

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

        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

        Thanks
        Jeanette

        Show
        kleopatra added a comment - 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 Thanks Jeanette

          People

          • Assignee:
            kleopatra
            Reporter:
            arkadi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: