Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-574

Add support for CSS-like type selectors

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      This will allow developers to ensure that a consistent set of styles is applied to all instances of a particular component type. Component#setSkin() will be updated to apply a predefined set of styles to each component instance as it is created. For example, a developer could say that all PushButtons should have the "

      {font:'Arial-BOLD-24'}

      " style applied at creation time.

      Type-specific styles will be defined in JSON files whose package and file name (with the exception of the extension) match the package and class name of the component to which they apply; e.g.:

      /org
      /apache
      /pivot
      /wtk
      PushButton.styles

      When the component is created, Component#setSkin() will look for a file with the same name as the component class, but with a .styles extension. If it finds one, it will apply the styles contained in the file to the new instance.

      Note the use of the .styles extension as opposed to .json. This is to disambiguate the style descriptor from any potential resource definitions associated with the class, since Resources currently use a .json extension.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gbrown Gregory K. Brown
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: