Re: RFR: 5021949: JSplitPane setEnabled(false) shouldn't be partially functional [v5]

2024-06-26 Thread Prasanta Sadhukhan
On Wed, 26 Jun 2024 09:00:28 GMT, Prasanta Sadhukhan  
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:
> 
>   Test update

I guess modified PR will solve the problem you reported...

-

PR Comment: https://git.openjdk.org/jdk/pull/19695#issuecomment-2191370461


Re: RFR: 5021949: JSplitPane setEnabled(false) shouldn't be partially functional [v5]

2024-06-26 Thread Alexey Ivanov
On Wed, 26 Jun 2024 09:00:28 GMT, Prasanta Sadhukhan  
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:
> 
>   Test update

Changes requested by aivanov (Reviewer).

src/java.desktop/share/classes/javax/swing/JSplitPane.java line 1:

> 1: /*

Copyright year to be updated in `JSplitPane`.

test/jdk/javax/swing/JSplitPane/TestSplitPaneEnableTest.java line 82:

> 80: jsp.setOneTouchExpandable(true);
> 81: 
> 82: jsp.setEnabled(false);

> It should be simpler, it could be done without rendering the frame.

I'm pretty sure it could be done *without creating a frame* and without showing 
the frame:

Suggestion:

jsp.setUI(new TestSplitPaneUI());
jsp.setOneTouchExpandable(true);

jsp.setEnabled(false);

if (leftOneTouchButton.isEnabled()) {
throw new RuntimeException("leftButton is enabled for 
disabled JSplitPane");
}
if (rightOneTouchButton.isEnabled()) {
throw new RuntimeException("rightButton is enabled for 
disabled JSplitPane");
}


Calling `jsp.setEnabled(false);` changes the state of the buttons immediately, 
doesn't it?

-

PR Review: https://git.openjdk.org/jdk/pull/19695#pullrequestreview-2141208110
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1654454389
PR Review Comment: https://git.openjdk.org/jdk/pull/19695#discussion_r1654450514


Re: RFR: 5021949: JSplitPane setEnabled(false) shouldn't be partially functional [v5]

2024-06-26 Thread Prasanta Sadhukhan
> 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:

  Test update

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19695/files
  - new: https://git.openjdk.org/jdk/pull/19695/files/655ab843..a728acf7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19695=04
 - incr: https://webrevs.openjdk.org/?repo=jdk=19695=03-04

  Stats: 22 lines in 1 file changed: 0 ins; 16 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/19695.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19695/head:pull/19695

PR: https://git.openjdk.org/jdk/pull/19695