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

JTable's TableCellRenderer's ignores border specified using the Synth L&F

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b97)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b97, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Linux arjans 2.6.11-gentoo-r6

      A DESCRIPTION OF THE PROBLEM :
      As previously reported in Bug #5041586 borders set using the setBorder() method on the DefaultTableCellRenderer class are ignored by the getTableCellRendererComponent() method.

      The solution to subclass and reset the border does not work with the Synth L&F. As the desired Border is described in the SynthStyle xml file, we need to use the default cellrenderer implementation of the Synth L&F. This renderer the private inner class SynthTableUI.SynthTableCellRenderer extends the DefaultTableCellRenderer class and therefore inherits the behaviour of ignore the supplied border.
      This is undesired behaviour especially for the Synth L&F, because the goal of this look and feel is to allow configuring the l&f of components without the need of extending or changing any component code.

      The inner class SynthTableUI.SynthTableCellRenderer should respect and use border supplied by the Synth L&F instead of adapting the default behaviour of the DefaultTableCellRenderer

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Add a style to the Synth configuration file for the Table.cellRenderer.

      For example:

        <style id="tablecell">
            <state>
                <imagePainter method="labelBorder" path="dummy.png"
                    sourceInsets="5 5 5 5" paintCenter="false" stretch="true"/>
                <insets top="5" bottom="5" left="5" right="5"/>
            </state>
        </style>
        <bind style="tablecell" type="name" key="Table.cellRenderer"/>

      The border in the style will be ignored by the table cell renderer.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The border as specified in the Synth style file should be respected and used as the border for the TableCellRenderer.
      ACTUAL -
      The border is ignored and a default border specified in the DefaultTableCellRenderer class is used.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      None, can not extend the SynthTableUI.SynthTableCellRenderer class (which is needed because of the link to the Synth UI classes)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: