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

SynthScrollBarUI should assign unique names to buttons

    Details

      Description

      A DESCRIPTION OF THE REQUEST :
      Currently SynthScrollBarUI assigns the name "ScrollBar.button" to both directional buttons (east and west if horizontal; north and south if vertical). This makes it impossible to bind a unique style to each button by its name using the default Synth Look & Feel.

      JUSTIFICATION :
      Most compound widgets in Synth that define multiple inner components differentiate between them so that they can be styled properly. For example, a SynthSpinnerUI names its buttons "Spinner.nextButton" and "Spinner.previousButton", allowing you to bind a different style to each using its name.

      Since SynthScrollBarUI just calls both of its buttons "ScrollBar.button", it is not possible to assign a style to each possible orientation (north, south, east, west) independantly.

      Currently the only option here is to style all four of the regular ArrowButtons, meaning that ArrowButtons have to look exactly the same as the buttons on every ScrollBar. This is workable but is obviously limiting in terms of style.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Since there are four possible scroolbar buttons (east and west for horizontal bars, north and south for vertical bars) it would be nice if the scroll bar named each one accordingly, i.e.:

      ScrollBar.upButton
      ScrollBar.downButton
      ScrollBar.leftButton
      ScrollBar.rightButton

      I should note that, conceptually, there are really only two buttons - one that increments and one that decrements. Therefore, one might suggest that the names should be something like:

      ScrollBar.incrementButton
      ScrollBar.decrementButton

      However, if we did this, then there would simply be a new variant of the existing problem - namely, you could style an "increment" button but you wouldn't be able to differentiate between a horizontally-oriented increment button (east-facing) and a vertically-oriented increment button (south-facing).

      Also, since the orientation of the scrollbar is queryable through the ScrollBar API, using the four names would still allow programmers to gain access to the correct component by name, i.e.:

      if (scrollbar.getOrientation == Adjustable.HORIZONTAL)
      {
          // get component by name "ScrollBar.left" or "ScrollBar.north"
      }
      else
      {
        // get component by name "ScrollBar.right" or "ScrollBar.south"
      }
      ACTUAL -
      The non-unique name "ScrollBar.button" is assigned to both the increment and decrement buttons regardless of orientation.

        Attachments

          Activity

            People

            • Assignee:
              gromainsunw Guy Romain (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: