RFR: 8336873: BasicSplitPaneDivider:oneTouchExpandableChanged() should mention that implementation depends on SplitPane.supportsOneTouchButtons property [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Jul 29 07:13:32 UTC 2024


On Sun, 28 Jul 2024 23:14:03 GMT, Phil Race <prr at openjdk.org> wrote:

> The only LAF I see that sets supportsOneTouchButtons is GTK and it sets it to false .. so nothing anywhere sets it to true ! And in the code being updated "true" is passed as the default value to DefaultLookup.getBoolean
> 
> So this seems to imply that a Laf has to consciously opt-out of one touch .. which is surprising to me. i.e you have to know about this property in the first place to opt-out .. and I don't see where it is documented so how can anyone writing a LaF know about it ? Is there not a central document about all of these ?

There are some more cases like this
`ColorChooser.showPreviewPanelText`
`OptionPane.setButtonMargin`
and I dont see any document or javadoc which document this properties

> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java line 399:
> 
>> 397:      * divider is contained in changes.
>> 398:      * If a particular L&F supports SplitPane.supportsOneTocuhButtons property
>> 399:      * it will create the
> 
> Tocuh ?

DId you want "touch" instead of "create"?
I guess it should be "create" as the code does```

/* Create the left button and add an action listener to
expand/collapse it. */
leftButton = createLeftOneTouchButton();

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

PR Comment: https://git.openjdk.org/jdk/pull/20289#issuecomment-2255113104
PR Review Comment: https://git.openjdk.org/jdk/pull/20289#discussion_r1694700824


More information about the client-libs-dev mailing list