kirill-grouchnikov / substance

A modern and high-performant Swing look-and-feel library
164 stars 109 forks source link

Single API surface for Substance-specific customizations #45

Closed kirill-grouchnikov closed 6 years ago

kirill-grouchnikov commented 6 years ago

At the present moment, Substance APIs are scattered across multiple places.

  1. SubstanceLookAndFeel class methods (static)
  2. SubstanceLookAndFeel string constants that are used as UIManager keys
  3. SubstanceLookAndFeel string constants that are used as component client property keys
  4. Implicit scanning of META-INF/substance-plugin.xml to find and instantiate plugins
  5. Implicit scanning of META-INF/lafwidget.properties to find and instantiate widgets

The plan is to unify all the APIs into a single tiered structure, where each tier explicitly specifies what is the scope of the specific API. The proposed tiers are:

  1. Global
  2. Root pane - all views in the specific root pane
  3. Component and children - applies to the component and its immediate children
  4. Component and descendants - applies to the component and all of its child hierarchy

(note that 2 is a special case of 4)

Each tier will expose APIs that are relevant to that tier. This means that there will be some duplication across tiers - such as setting focus kind on component and descendants (4), as well as globally (1).