On Fri, 14 Jun 2024 20:39:25 GMT, Alisen Chung <[email protected]> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Omit gtk
>
> src/java.desktop/share/classes/javax/swing/JSplitPane.java line 372:
>
>> 370: public void setEnabled(boolean enabled) {
>> 371: super.setEnabled(enabled);
>> 372:
>> ((BasicSplitPaneUI)(this.getUI())).getDivider().setEnabled(enabled);
>
> is it fine to assume that the UI is a BasicSplitPaneUI object? what happens
> if the JSplitPane UI is an AquaSplitPaneUI for example?
All L&F including Aqua extends BasicSplitPaneUI so it's ok...The existing test
iterates through all L&F without any issue..
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java
> line 369:
>
>> 367: @Override
>> 368: public void setEnabled(boolean enabled) {
>> 369: if (splitPane.isOneTouchExpandable() &&
>
> i think for setEnabled the buttons should be enabled/disabled regardless of
> if splitPane isOneTouchExpandable is true so that the state is preserved even
> if setEnabled(false) is called before
> setOneTouchExpandable(true)
No, the left and right arrow buttons are created ONLY when
`isOneTouchExpandable` is true so it should be checked here too to
enable/disable actions
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1642181720
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1642179508