Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6290678

Add new selection mode to Swing ListModel to allow "defensive selection"

    XMLWordPrintable

    Details

    • Subcomponent:
    • Understanding:
      Cause Known
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      The Swing DefaultListModel implementation should allow a new kind of selection mode, which provides "defensive multiple selection" behavior. This would be very similar to MULTIPLE_INTERVAL_SELECTION, but when a new item is inserted into the list at a position where the selection previously existed, that new item would NOT be added to the selection. So, the selection would be "defensive" in that it would only select items which were explicitly selected by the user.

      JUSTIFICATION :
      Personally I think the current behavior of MULTIPLE_INTERVAL_SELECTION is unintuitive. When a new item is added near the selection, it is included in the selection. I can't imagine a common scenario where this would be desirable.


      CUSTOMER SUBMITTED WORKAROUND :
      Use Glazed Lists, and use EventSelectionModel instead of DefaultSelectionModel.
      ###@###.### 2005-06-24 22:52:38 GMT

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: