swingx
  1. swingx
  2. SWINGX-1339

DefaultXXRenderer: set name of rendering component for Synth-based LAF

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.6
    • Component/s: Renderer
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,339

      Description

      Synth-based LAFs may expect a component with a particular name to denote its
      role as rendering component, ie

      "Table.cellRenderer"
      "TableHeader.renderer"
      list ??
      tree ??

      SwingX DefaultXXRenderers should set them accordingly - in
      getXXRendererComponent, because the provider can be shared across component types

        Activity

        Hide
        kleopatra added a comment -

        the names for tree/list are:

        "List.cellRenderer"
        "Tree.cellRenderer"

        fixed:
        names are reset to "XX.cellRenderer" in each call to getXXRendererComponent
        added tests

        Show
        kleopatra added a comment - the names for tree/list are: "List.cellRenderer" "Tree.cellRenderer" fixed: names are reset to "XX.cellRenderer" in each call to getXXRendererComponent added tests
        Hide
        kleopatra added a comment -

        thinking about it:

        • the DefaultXXRenderers are glue-only, don't let them decide anything
        • CellContext looks like the place to lookup the appropriate name (they are consistent,
          so can be implemented in the base class)
        • DefaultVisuals are meant to transfer all properties from context to concrete component,
          add name to the list
        Show
        kleopatra added a comment - thinking about it: the DefaultXXRenderers are glue-only, don't let them decide anything CellContext looks like the place to lookup the appropriate name (they are consistent, so can be implemented in the base class) DefaultVisuals are meant to transfer all properties from context to concrete component, add name to the list
        Hide
        kleopatra added a comment -

        fixed along the lines of my second comment move responsibility out off the renderer into
        the cellContext/DefaultVisuals
        updated doc, adjusted tests

        Show
        kleopatra added a comment - fixed along the lines of my second comment move responsibility out off the renderer into the cellContext/DefaultVisuals updated doc, adjusted tests
        Hide
        Karl Schaefer added a comment -

        Is there a special name for the JComboBox's renderer?

        Show
        Karl Schaefer added a comment - Is there a special name for the JComboBox's renderer?
        Hide
        kleopatra added a comment -

        good catch - indeed, there are even two: "ComboBox.renderer" and "ComboBox.listRenderer"

        • not sure which is used when. We don't have a ComboBoxContext, or do we?
        Show
        kleopatra added a comment - good catch - indeed, there are even two: "ComboBox.renderer" and "ComboBox.listRenderer" not sure which is used when. We don't have a ComboBoxContext, or do we?
        Hide
        Karl Schaefer added a comment -

        No we do not have a ComboBoxCellContext. Since JComboBox uses ListCellRenderer
        to perform rendering, I never bothered to build another glue renderer to have a
        separate cell context.

        The JList in the ComboPopup is named in Basic it is "ComboBox.list". It might
        be fragile, but we could introspect the name of the supplied JList and if it is
        the special name, then we use the JComboBox rendering names.

        Show
        Karl Schaefer added a comment - No we do not have a ComboBoxCellContext. Since JComboBox uses ListCellRenderer to perform rendering, I never bothered to build another glue renderer to have a separate cell context. The JList in the ComboPopup is named in Basic it is "ComboBox.list". It might be fragile, but we could introspect the name of the supplied JList and if it is the special name, then we use the JComboBox rendering names.
        Hide
        kleopatra added a comment -

        Karl,

        feel free to take over and change as you suggested, it can't get worse than it had been
        before forcing the names Synth-based LAFs are nasty at their best and pure hell elsewhere...

        CU
        Jeanette

        Show
        kleopatra added a comment - Karl, feel free to take over and change as you suggested, it can't get worse than it had been before forcing the names Synth-based LAFs are nasty at their best and pure hell elsewhere... CU Jeanette

          People

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

            Dates

            • Created:
              Updated: