swingx
  1. swingx
  2. SWINGX-1297

GTK: NPE when setting border of non-label renderer components (core bug)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.3
    • Component/s: Renderer
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,297

      Description

      reported in

      http://forums.java.net/jive/thread.jspa?threadID=77690

      the core issue is that the GTKPainter$ListTableFocusBorder is a broken implementation
      (returns null for insets of non-label components)

      SwingX can/should work around with a custom wrapping border (as suggested in the thread)
      until core is fixed.

        Activity

        kleopatra created issue -
        Hide
        Karl Schaefer added a comment -

        Issue 1297: Added a wrapping border to ensure that Synth does not return null
        insets from getBorderInsets.

        src/java/org/jdesktop/swingx/plaf/linux/LinuxLookAndFeelAddons.java
        src/java/org/jdesktop/swingx/plaf/linux/SafeBorder.java

        Committed revision 3637.

        Show
        Karl Schaefer added a comment - Issue 1297: Added a wrapping border to ensure that Synth does not return null insets from getBorderInsets. src/java/org/jdesktop/swingx/plaf/linux/LinuxLookAndFeelAddons.java src/java/org/jdesktop/swingx/plaf/linux/SafeBorder.java Committed revision 3637.
        Hide
        Karl Schaefer added a comment -

        Awaiting feedback from GTK users.

        Show
        Karl Schaefer added a comment - Awaiting feedback from GTK users.
        Hide
        kleopatra added a comment -

        not on GTK, nevertheless a couple of comments:

        • SafeBorder is not yet used
        • wouldn't install it unconditionally, only if the Border coming from the ui is a GTKPainter&ListTableFocusBorder
          (checking the name is cheap enough)
        • all the potential entries should be checked and replaced (that's the focusSelected,
          focused and noFocus, the exact names are in the thread)
        • they probably come for list and tree as well (Guilaume, could you please check? Karl
          and me are both more or less blind on the GTK eye
        • in the SafeBorder, how about asking super for the insets and only jump in with a label
          if it comes out with a null? Feels less intrusive
        • would prefer the label as a field instead of recreating on each call
        • maybe extend AbstractBorder instead of implementing from scratch? There are places in
          the LAF which are optimized and go through the getBorderInsets(comp, inset) with a not-null
          inset

        Happy coding! And testing <g>

        CU
        Jeanette

        Show
        kleopatra added a comment - not on GTK, nevertheless a couple of comments: SafeBorder is not yet used wouldn't install it unconditionally, only if the Border coming from the ui is a GTKPainter&ListTableFocusBorder (checking the name is cheap enough) all the potential entries should be checked and replaced (that's the focusSelected, focused and noFocus, the exact names are in the thread) they probably come for list and tree as well (Guilaume, could you please check? Karl and me are both more or less blind on the GTK eye in the SafeBorder, how about asking super for the insets and only jump in with a label if it comes out with a null? Feels less intrusive would prefer the label as a field instead of recreating on each call maybe extend AbstractBorder instead of implementing from scratch? There are places in the LAF which are optimized and go through the getBorderInsets(comp, inset) with a not-null inset Happy coding! And testing <g> CU Jeanette
        Hide
        kleopatra added a comment -
            • Issue 1351 has been marked as a duplicate of this issue. ***
        Show
        kleopatra added a comment - Issue 1351 has been marked as a duplicate of this issue. ***
        Hide
        Karl Schaefer added a comment -

        Hadn't heard anything more on this. Where are we?

        Jeanette, are you able to test GTK? You were doing those Synth updates a bit
        ago? I have no way of running this though I can make some coding progress in a
        vacuum if you want.

        Show
        Karl Schaefer added a comment - Hadn't heard anything more on this. Where are we? Jeanette, are you able to test GTK? You were doing those Synth updates a bit ago? I have no way of running this though I can make some coding progress in a vacuum if you want.
        Hide
        kleopatra added a comment -

        not really - locally I have a project which contains the gtk plaf from openjdk, so I can
        set the gtk laf, kind of. Not really working, currently just see a table without cells

        • but can blind-click somewhere in a boolean columns and so reproduce the stack trace.
        Show
        kleopatra added a comment - not really - locally I have a project which contains the gtk plaf from openjdk, so I can set the gtk laf, kind of. Not really working, currently just see a table without cells but can blind-click somewhere in a boolean columns and so reproduce the stack trace.
        Hide
        kleopatra added a comment -
        Show
        kleopatra added a comment - core issue is: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6739738 a maybe related and maybe fixed one: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6963870
        Hide
        kleopatra added a comment -

        taking

        Show
        kleopatra added a comment - taking
        Hide
        kleopatra added a comment -

        Karl,

        I decided against the hammer Don't want to save the world, just make SwingX renderers
        safe enough. Client code accessing the GTK installed unsafe borders before a Table/List
        is instantiated are on their own. The core issue looks fixed as of 7-b102 which fixed
        the base issue (which is a crappy AbstractBorder implementation)

        • added SafeBorder to package plaf, deprecated the existing in package linux
        • added border replacing code in TableAddon, ListAddon if GTK is detected
        • added tests

        @OP, could you please check if this really solves the problem? We are blind on the Linux
        eye

        committed as of revision #3879 (Hudson's down - so checkout from svn is the only option
        to get the latest code, sigh...)

        Thanks
        Jeanette

        Show
        kleopatra added a comment - Karl, I decided against the hammer Don't want to save the world, just make SwingX renderers safe enough. Client code accessing the GTK installed unsafe borders before a Table/List is instantiated are on their own. The core issue looks fixed as of 7-b102 which fixed the base issue (which is a crappy AbstractBorder implementation) added SafeBorder to package plaf, deprecated the existing in package linux added border replacing code in TableAddon, ListAddon if GTK is detected added tests @OP, could you please check if this really solves the problem? We are blind on the Linux eye committed as of revision #3879 (Hudson's down - so checkout from svn is the only option to get the latest code, sigh...) Thanks Jeanette
        Hide
        kleopatra added a comment -

        closing (want my desk clear <g>) Simply reopen if there still are problems

        Jeanette

        Show
        kleopatra added a comment - closing (want my desk clear <g>) Simply reopen if there still are problems Jeanette
        Hide
        kleopatra added a comment -

        cc'ed to reporter of the duplicate (not sure if the tracker handles that notification
        automatically)

        Show
        kleopatra added a comment - cc'ed to reporter of the duplicate (not sure if the tracker handles that notification automatically)
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 1297 85557
        Karl Schaefer made changes -
        Affects Version/s 1.6.1 [ 13360 ]
        Affects Version/s 1.6++ [ 13359 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: