swingx
  1. swingx
  2. SWINGX-271

TableSorting doesn't handle double clicks

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.3
    • Component/s: Table
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      271

      Description

      When you want to quickly sort a table column in reverse order, it is intuitive to click on the header twice:
      once for forward order and another time to reverse that order. But the second click is lost and the table is
      sorted in forward order.

      To demo this behaviour, open Mac Finder (or Windows Explorer) and double click on a column's header.
      The column sorts once for each click.

      On JXTable, the table ignores clicks after the first one.

        Activity

        jessewilson created issue -
        Hide
        kleopatra added a comment -

        Hmm, the behaviour is copied from win2k explorer: a double click triggers only
        one toggle of sort order

        CC'd to usability - Ann could you please comment on this?

        Jeanette

        Show
        kleopatra added a comment - Hmm, the behaviour is copied from win2k explorer: a double click triggers only one toggle of sort order CC'd to usability - Ann could you please comment on this? Jeanette
        Hide
        anns97 added a comment -

        Jeanette, how fast can the sort and repaint happen?

        When I played with Mac Finder, I noticed that in the amt of time I can do a
        double click, it actually shows the sort first in one direction, and then in the
        other direction, which produces the end result that the original issue filer
        asked for.

        I noticed Mozilla Thunderbird also has this behavior too.

        That behavior makes sense to me - consistent and fast feedback.

        But if there are any performance problems with the sort & repaint, then we might
        look at a different soln (which may be to keep the current behavior)

        Show
        anns97 added a comment - Jeanette, how fast can the sort and repaint happen? When I played with Mac Finder, I noticed that in the amt of time I can do a double click, it actually shows the sort first in one direction, and then in the other direction, which produces the end result that the original issue filer asked for. I noticed Mozilla Thunderbird also has this behavior too. That behavior makes sense to me - consistent and fast feedback. But if there are any performance problems with the sort & repaint, then we might look at a different soln (which may be to keep the current behavior)
        Hide
        jessewilson added a comment -

        You're right about Windows 2000, I was comparing against the Mac Finder. Interestingly when you click 3
        times on Windows 2000 you get sort then resort, but JXTable you only get a single sort. This is a weird
        thing to test and I wouldn't say JXTable needs a different behaviour in this case.

        I just found it annoying when I tried to sort a column in reverse, it refused to do it 'cause I kept clicking
        too fast, and most of my clicks were dropped.

        Show
        jessewilson added a comment - You're right about Windows 2000, I was comparing against the Mac Finder. Interestingly when you click 3 times on Windows 2000 you get sort then resort, but JXTable you only get a single sort. This is a weird thing to test and I wouldn't say JXTable needs a different behaviour in this case. I just found it annoying when I tried to sort a column in reverse, it refused to do it 'cause I kept clicking too fast, and most of my clicks were dropped.
        Hide
        kleopatra added a comment -

        Ann, performance shouldn't be a problem (normally), at least we can decide
        without taking into account.

        Hmm, just had a look at Thunderbird: it does take all clicks to trigger a sort
        which feels funny for a already sorted column because in the end the sequence is
        the same as before the first of the douple-clicks.

        Mustang takes the first click only (my build is somewhere in the late sixties).

        JXTable could go either way, or behave differently if the column is unsorted, or
        make the behaviour configurable? ... Personally I prefer to react on a single
        click only (and ignore the second of a double), but I'm open to be convinced.

        Jeanette

        Show
        kleopatra added a comment - Ann, performance shouldn't be a problem (normally), at least we can decide without taking into account. Hmm, just had a look at Thunderbird: it does take all clicks to trigger a sort which feels funny for a already sorted column because in the end the sequence is the same as before the first of the douple-clicks. Mustang takes the first click only (my build is somewhere in the late sixties). JXTable could go either way, or behave differently if the column is unsorted, or make the behaviour configurable? ... Personally I prefer to react on a single click only (and ignore the second of a double), but I'm open to be convinced. Jeanette
        Hide
        kleopatra added a comment -
        • added JXTableHeader.SortGestureRecognizer and property
        • made JXTableHeader.HeaderListener let the recognizer decide
        • added visual test method (toggles between default and custom recognizer) to
          JXTableVisualCheck

        Note: this is not formally tested, just a quick check if the double click can be
        easily used for sorting! Would like to get feedback, the factoring might well be
        incomplete...

        Jeanette

        Show
        kleopatra added a comment - added JXTableHeader.SortGestureRecognizer and property made JXTableHeader.HeaderListener let the recognizer decide added visual test method (toggles between default and custom recognizer) to JXTableVisualCheck Note: this is not formally tested, just a quick check if the double click can be easily used for sorting! Would like to get feedback, the factoring might well be incomplete... Jeanette
        Hide
        kleopatra added a comment -


        no complaints - so I'm closing

        Show
        kleopatra added a comment - no complaints - so I'm closing
        Hide
        kleopatra added a comment -

        re-open, as in the process of moving over to core sorting (jdk6+) the
        SortGestureRecognizer is currently no longer used. Need to evalutate if/how we
        can do ...

        Show
        kleopatra added a comment - re-open, as in the process of moving over to core sorting (jdk6+) the SortGestureRecognizer is currently no longer used. Need to evalutate if/how we can do ...
        Hide
        kleopatra added a comment -

        re-added:

        • JXTableHeader has a property resortsOnDoubleClick
        • its HeaderListener contains logic to toggle a second sort if that property is true and
          the column was unsorted before
        • added convenience api to JXTable to request the primary sort column index if existing
          and visible
        Show
        kleopatra added a comment - re-added: JXTableHeader has a property resortsOnDoubleClick its HeaderListener contains logic to toggle a second sort if that property is true and the column was unsorted before added convenience api to JXTable to request the primary sort column index if existing and visible
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 271 84531
        Karl Schaefer made changes -
        Affects Version/s 1.6 [ 13358 ]
        Affects Version/s 1.0++ [ 13357 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: