On Fri, 14 Jun 2024 09:28:28 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> Issue is seen in that if we call setEnabled(false) over JSplitPane than it 
>> can't be dragged via its divider, But if SplitPane have one touch expandable 
>> true than user can click those buttons and change the divider position. 
>> So, if splitpane is disabled, then both dragging in divider and 
>> one-touch-expandable click should be disabled.
>> Fix is made to override setEnabled and disable one-touch-expandable buttons 
>> actions..
>
> 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?

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)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1640334460
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1640329308

Reply via email to