diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatStyleableComponent.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatStyleableComponent.java index d2b3c70c..bdf1fb77 100644 --- a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatStyleableComponent.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatStyleableComponent.java @@ -34,6 +34,8 @@ public interface FlatStyleableComponent /** * Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") * or {@code null} if no style has been assigned. + * + * @see FlatClientProperties#STYLE */ default String getStyle() { return (String) getClientProperty( FlatClientProperties.STYLE ); @@ -48,6 +50,8 @@ public interface FlatStyleableComponent * The syntax of the CSS values is the same as used in FlatLaf properties files * (https://www.formdev.com/flatlaf/properties-files/), * but some features are not supported (e.g. variables). + * + * @see FlatClientProperties#STYLE */ default void setStyle( String style ) { putClientProperty( FlatClientProperties.STYLE, style ); @@ -57,6 +61,8 @@ public interface FlatStyleableComponent /** * Returns the style of a component as {@link java.util.Map}<String, Object> * or {@code null} if no style has been assigned. + * + * @see FlatClientProperties#STYLE */ @SuppressWarnings( "unchecked" ) default Map getStyleMap() { @@ -70,12 +76,34 @@ public interface FlatStyleableComponent * E.g. for UI default {@code Slider.thumbSize} use key {@code thumbSize}. *

* The values are not parsed from a string. They must be binary. + * + * @see FlatClientProperties#STYLE */ default void setStyleMap( Map styleMap ) { putClientProperty( FlatClientProperties.STYLE, styleMap ); } + /** + * Returns the style class(es) of a component (separated by space characters) + * or {@code null} if no style class has been assigned. + * + * @see FlatClientProperties#STYLE_CLASS + */ + default String getStyleClass() { + return (String) getClientProperty( FlatClientProperties.STYLE_CLASS ); + } + + /** + * Specifies the style class(es) of a component (separated by space characters). + * + * @see FlatClientProperties#STYLE_CLASS + */ + default void setStyleClass( String styleClass ) { + putClientProperty( FlatClientProperties.STYLE_CLASS, styleClass ); + } + + /** * Overrides {@link JComponent#getClientProperty(Object)}. */