swingx
  1. swingx
  2. SWINGX-1181

Tree.scrollPathToVisible() doesn't always work in JXTaskPanes

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.6
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,181

      Description

      I have a JPanel with a JScrollPane whose content is a JXTaskPaneContainer.
      The JXTaskPaneContainer has several JXTaskPanes, each of which contains a JTree
      in its ContentPane.

      Our application lets the user search for a string pattern that may be found in
      any of the trees. When a node is found, the code expands the tree (if not
      already), selects the node and tries to show it in the Viewport of the overall
      containing JScrollPane using:
      tree.scrollPathToVisible();

      This worked in 0.93 of swingx. When I moved to swingx 1.0, it stopped working.
      I described the problem and gave sample code in the swinglabs forum:
      http://forums.java.net/jive/thread.jspa?messageID=365289&#365289

      Jeanette and Karl agreed that it's a problem and suggested I create a bug.

        Activity

        Hide
        kleopatra added a comment -

        Looks like we can override the scrollRectToVisible in the JCollapsiblePane.WrapperContainer
        with a c&p of JComponent code (effectively remove some JViewport-ness). Can't be sure
        about possible side-effects, so leaving to the expert

        Cheers
        Jeanette

        Show
        kleopatra added a comment - Looks like we can override the scrollRectToVisible in the JCollapsiblePane.WrapperContainer with a c&p of JComponent code (effectively remove some JViewport-ness). Can't be sure about possible side-effects, so leaving to the expert Cheers Jeanette
        Hide
        kleopatra added a comment -
        • added a visual test to JXTaskPaneIssues to expose
        • implemented the wrapper container scrollRectToVisible (but commented the code - don't
          quite dare to uncomment without a second opinion

        CU
        Jeanette

        Show
        kleopatra added a comment - added a visual test to JXTaskPaneIssues to expose implemented the wrapper container scrollRectToVisible (but commented the code - don't quite dare to uncomment without a second opinion CU Jeanette
        Hide
        Karl Schaefer added a comment -

        Jeanette nice work in determining the underlying problem. I chose instead of
        doing a c&p of JComponent's scrollRectToVisible code to call
        JXCollaspiblePane.this.scrollRectToVisible(rect). This gives us the JComponent
        code without the c&p.

        Show
        Karl Schaefer added a comment - Jeanette nice work in determining the underlying problem. I chose instead of doing a c&p of JComponent's scrollRectToVisible code to call JXCollaspiblePane.this.scrollRectToVisible(rect). This gives us the JComponent code without the c&p.
        Hide
        kleopatra added a comment -

        very clean solution

        Thanks
        Jeanette

        Show
        kleopatra added a comment - very clean solution Thanks Jeanette
        Hide
        kleopatra added a comment -


        changed target of fixed for release 1.6

        Show
        kleopatra added a comment - changed target of fixed for release 1.6

          People

          • Assignee:
            Karl Schaefer
            Reporter:
            tjwolf
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: