RFR: 6513512: MetalLookAndFeel.initClassDefaults does not install an entry for MetalMenuBarUI [v3]
Phil Race
prr at openjdk.org
Sat Jan 7 02:08:52 UTC 2023
On Thu, 29 Dec 2022 06:22:01 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Spec for [MetalLookAndFeel](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java#L247)
>> says:
>> "...MetalLookAndFeel registers an entry for each of the classes
>> in the package javax.swing.plaf.metal that are named MetalXXXUI.
>> The string XXX is one of Swing's uiClassIDs. For the uiClassIDs
>> that do not have a class in metal, the corresponding class in
>> javax.swing.plaf.basic is used. For example, metal does not
>> have a class named "MetalColorChooserUI", as such,
>> javax.swing.plaf.basic.BasicColorChooserUI is used".
>>
>> There is class MetalMenuBarUI, but the method populates given defaults table with the value
>> "javax.swing.plaf.basic.BasicMenuBarUI".
>>
>> Added entry for MetalMenuBarUI..
>> CI tests including JCK tests are ok.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Spec update
src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java line 255:
> 253: * "MetalColorChooserUI"}, as such, {@code
> 254: * javax.swing.plaf.basic.BasicColorChooserUI} is used.
> 255: * It is to be noted that some MetalXXXUI classes can be used only by
Seems to me that this needs to be introduced in the previous paragraph otherwise you are revising what is said there in an awkward way.
So we can add to "{@code
* MetalLookAndFeel} registers an entry for each of the classes in
* the package {@code javax.swing.plaf.metal} that are named
* MetalXXXUI"
just this one extra clause :
", which are used by the current {@code MetalTheme}"
Technically that is ALL that is needed.
But at line 255 we then can (since 252- 254 already set precedent) say
"And {@code MetalMenuBarUI} is an example of a UI class that is used only by one provided theme : {@code OceanTheme}, and therefore will not be registered by the other provided themes"
-------------
PR: https://git.openjdk.org/jdk/pull/11646
More information about the client-libs-dev
mailing list