On Thu, 1 Oct 2026 21:24:17 GMT, Michael Strauß <[email protected]> wrote:
>> Martin Fox has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Fixed some bugs in how window flags are set up.
>
> modules/javafx.graphics/src/main/java/javafx/stage/StageBackdropStyle.java
> line 119:
>
>> 117: * backdrop styles
>> 118: */
>> 119: public static List<String> getPlatformStyleNames() {
>
> I'd start with minimal API first, then only add more if there's an
> established use case. So `getPlatformStyleNames` and `getStandardStyles`
> would be on my chopping block, as these are easily reproducible by
> application developers.
I added `getStandardStyles` while prototyping CSS integration. I needed to
iterate over the standard styles and wanted to ensure that if a new standard
style was added I wouldn't have to update the CSS code manually. If the
standard styles were an enum this wouldn't be necessary since application
developers could use Java mechanisms for iterating over the values.
`getStandardStyles` is the next best thing.
I still believe that `getPlatformStyleNames` is the API most developers will
use. `getPlatformStyles` is ambiguous; on each call does it return the same
list or a newly built list? It matters when you have styles that take options.
Currently the code builds a new list each time just to ensure that those styles
have default options. If new styles have to be built each time it makes more
sense (to me) to iterate over the names and let developers create new styles
themselves.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2048#discussion_r4197592919