On Fri, 3 Jan 2025 20:05:13 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

> > > I wonder if such a customisation is supported. Synth and Nimbus don't 
> > > always use the `UIMaganager` to set the defaults. Perhaps, these 
> > > Look-and-Feels should be excluded from this test.
> > > On the other hand, Swing usually allows such customisations and respects 
> > > settings in `UIManger`… but doing so in Synth and Nimbus often looks 
> > > inconsistent and requires special handling of UI-delegate classes.
> > 
> > 
> > I thought about ignoring this property for Synth and probably close "Not an 
> > issue" but I could not find in spec of not honoring UIManager properties in 
> > Synth so added this fix...I guess we can argue for both for and against of 
> > adding this support in Synth but since it's pretty early in jdk25 mainline 
> > so any problem arising out of this can be tackled before the final release..
> 
> What I don't like with the current approach is that we'll need to add an 
> `instanceof` for each component to support customisation. If `UIManager` 
> properties should be honoured, `SynthContext`, `SynthStyle` or whatever holds 
> the defaults should look up properties in `UIManager` too. The [`SynthStyle` 
> class](https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/plaf/synth/SynthStyle.html)
>  represents “a set of style properties.” It loads the defaults from a synth 
> file…
> 
> Anyway, it's out of scope for the current fix. If it's a one-off fix for one 
> component, it's okay to handle it this way. Yet if the number of components 
> and/or properties grows, we should rethink how Synth-based look-and-feels can 
> be customised via `UIManager` just like all other L&Fs.

It is supposed to be one-off fix so I did via this instanceof check but if more 
such widgets needs UIManager lookup, then I was thinking of introducing an 
"else" block to "! instanceof SynthUI" check since I guess most of the widget 
could be of SynthUI subclass

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22908#issuecomment-2572338695

Reply via email to