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

MetalLookAndFeel.initClassDefaults does not install an entry for MetalMenuBarUI

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P3 P3
    • tbd
    • client-libs
    • None
    • behavioral
    • minimal
    • Implemented behaviour is documented and clarified
    • Java API
    • SE

      Summary

      Clarify in MetalLookAndFeel.initClassDefaults that entries are added only for UI classes which are sub-classed by Metal and are used by the MetalTheme being installed.

      Problem

      The specification for MetalLookAndFeel.initClassDefaults mentions that an entry for each of the classes in the package javax.swing.plaf.metal that are named MetalXXXUI should be registered in the method. If it is not, it means the corresponding class in javax.swing.plaf.basic is used.

      MetalMenuBarUI entry is not registered in this method although is is part of javax.swing.plaf.metal since it is registered in OceanTheme class, which is used by MetalLookAndFeel by default.

      Solution

      MetalLookAndFeel.initClassDefaults spec is updated to mention MetalMenuBarUI entry is registered in OceanTheme class

      Specification

      javax.swing.plaf.metal.MetalLookAndFeel.

         /**
            * Populates {@code table} with mappings from {@code uiClassID} to
            * the fully qualified name of the ui class. {@code
            * MetalLookAndFeel} registers an entry for each of the classes in
            * the package {@code javax.swing.plaf.metal} that are named
      -     * MetalXXXUI. The string {@code XXX} is one of Swing's uiClassIDs. For
      +     * MetalXXXUI which are used by the current {@code MetalTheme}.
      +     * The string {@code XXX} is one of Swing's uiClassIDs. For
            * the {@code uiClassIDs} that do not have a class in metal, the
            * corresponding class in {@code javax.swing.plaf.basic} is
      -     * used. For example, metal does not have a class named {@code
      +     * used.
      +     * For example, metal does not have a class named {@code
            * "MetalColorChooserUI"}, as such, {@code
            * javax.swing.plaf.basic.BasicColorChooserUI} is used.
      +     * And {@code MetalMenuBarUI} is an example of a UI class
      +     * that is registered and used only in one theme : {@code OceanTheme},
      +     * and therefore will not be registered by {@code MetalLookAndFeel}
      +     * and the other provided themes"
            *
            * @param table the {@code UIDefaults} instance the entries are
            *        added to
            * @throws NullPointerException if {@code table} is {@code null}
            *         
             protected void initClassDefaults(UIDefaults table)

            psadhukhan Prasanta Sadhukhan
            dmiltsov Dmitry Miltsov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: