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

Inconsistent Responsibility for changing TreeSelection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P4
    • None
    • 6u3
    • client-libs

    Description

      J2SE Version (please include all output from java -version flag):
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

      Does this problem occur on J2SE 5.0.x or 6.0? Yes / No (pick one)
      Yes

      Operating System Configuration Information (be specific):
      Microsoft Windows XP [Version 5.1.2600]

      Bug Description:
      Inconsistent Responsibility for changing TreeSelection

      When collapsing a node, removing a node and even switching the tree model the Tree and its associated
      TreeModelHandler are responsible for removing the now invalid selected paths.

      However when calling setRoot(null) on the DefaultTreeModel (or any other complete change to a TreeModel),
      the LayoutCache is responsible for removing the now invalid selected paths.

      This has not been documented and so when developers write their own implementation of a Layout Cache
      they need to also remove the invalid selected paths for this one case. I think the
      TreeModelHandler.treeStructureChanged method should be changed to clear the selection instead of
      the LayoutCache having to clear the selection for this case.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: