SplitPane:

- update divider when client property `JSplitPane.expandableSide` changed
- Extras: added support for `JSplitPane.expandableSide` client property to `FlatSplitPane`
This commit is contained in:
Karl Tauber
2024-03-24 12:42:39 +01:00
parent 3b3d7d76eb
commit bd60a18ff4
3 changed files with 35 additions and 2 deletions

View File

@@ -16,6 +16,7 @@
package com.formdev.flatlaf.extras.components;
import static com.formdev.flatlaf.FlatClientProperties.*;
import javax.swing.JSplitPane;
/**
@@ -26,6 +27,29 @@ import javax.swing.JSplitPane;
*/
public class FlatSplitPane
extends JSplitPane
implements FlatStyleableComponent
implements FlatComponentExtension, FlatStyleableComponent
{
// NOTE: enum names must be equal to allowed strings
/** @since 3.4.1 */ public enum ExpandableSide { both, left, right }
/**
* Returns what side of the spilt pane is allowed to expand
* via one-touch expanding arrow buttons.
*
* @since 3.4.1
*/
public ExpandableSide getExpandableSide() {
return getClientPropertyEnumString( SPLIT_PANE_EXPANDABLE_SIDE, ExpandableSide.class,
null, ExpandableSide.both );
}
/**
* Specifies what side of the spilt pane is allowed to expand
* via one-touch expanding arrow buttons.
*
* @since 3.4.1
*/
public void setExpandableSide( ExpandableSide expandableSide ) {
putClientPropertyEnumString( SPLIT_PANE_EXPANDABLE_SIDE, expandableSide );
}
}