-
Bug
-
Resolution: Fixed
-
P3
-
18
-
b13
This is a follow up to JDK-8272229, which missed to mention that the reference implementation of ::oneTouchExpandableChanged behaves the following way on a variety of OpenJDK versions, starting from old ones:
if (!DefaultLookup.getBoolean(splitPane, splitPaneUI,
"SplitPane.supportsOneTouchButtons", true)) {
// Look and feel doesn't want to support one touch buttons, bail.
return;
}
if (splitPane.isOneTouchExpandable() &&
leftButton == null &&
rightButton == null) {
/* Create the left button and add an action listener to
expand/collapse it. */
...
As a result, for example, with -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel installed, the buttons are not initialized.
Please see code sample attached.
When running the code on Linux:
> /jdk-21/bin/java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel Test.java
divider.leftButton() = null
divider.rightButton() = null
splitPane.isOneTouchExpandable() = true
divider.leftButton() = null
divider.rightButton() = null
> /jdk-21/bin/java /scratch/jdk-cache/21/35/jdk-21/bin/java Test.java
divider.leftButton() = null
divider.rightButton() = null
splitPane.isOneTouchExpandable() = true
divider.leftButton() = javax.swing.plaf.basic.BasicSplitPaneDivider$1[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=,flags=4194600,maximumSize=,minimumSize=java.awt.Dimension[width=6,height=6],preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true]
divider.rightButton() = javax.swing.plaf.basic.BasicSplitPaneDivider$1[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=,flags=4194600,maximumSize=,minimumSize=java.awt.Dimension[width=6,height=6],preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true]
if (!DefaultLookup.getBoolean(splitPane, splitPaneUI,
"SplitPane.supportsOneTouchButtons", true)) {
// Look and feel doesn't want to support one touch buttons, bail.
return;
}
if (splitPane.isOneTouchExpandable() &&
leftButton == null &&
rightButton == null) {
/* Create the left button and add an action listener to
expand/collapse it. */
...
As a result, for example, with -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel installed, the buttons are not initialized.
Please see code sample attached.
When running the code on Linux:
> /jdk-21/bin/java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel Test.java
divider.leftButton() = null
divider.rightButton() = null
splitPane.isOneTouchExpandable() = true
divider.leftButton() = null
divider.rightButton() = null
> /jdk-21/bin/java /scratch/jdk-cache/21/35/jdk-21/bin/java Test.java
divider.leftButton() = null
divider.rightButton() = null
splitPane.isOneTouchExpandable() = true
divider.leftButton() = javax.swing.plaf.basic.BasicSplitPaneDivider$1[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=,flags=4194600,maximumSize=,minimumSize=java.awt.Dimension[width=6,height=6],preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true]
divider.rightButton() = javax.swing.plaf.basic.BasicSplitPaneDivider$1[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=,flags=4194600,maximumSize=,minimumSize=java.awt.Dimension[width=6,height=6],preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true]
- clones
-
JDK-8272229 BasicSplitPaneDivider:oneTouchExpandableChanged() returns leftButton and rightButton as null with GTKLookAndFeel
-
- Resolved
-
- csr for
-
JDK-8336947 BasicSplitPaneDivider:oneTouchExpandableChanged() should mention that implementation depends on SplitPane.supportsOneTouchButtons property
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/eb7ead58
-
Review(master) openjdk/jdk/20289