RFR: 5021949: JSplitPane setEnabled(false) shouldn't be partially functional [v3]
Alisen Chung
achung at openjdk.org
Fri Jun 14 20:42:12 UTC 2024
On Fri, 14 Jun 2024 09:28:28 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> 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
More information about the client-libs-dev
mailing list