Interface FlatStyleableComponent
-
- All Known Implementing Classes:
FlatButton
,FlatCheckBox
,FlatCheckBoxMenuItem
,FlatComboBox
,FlatEditorPane
,FlatFormattedTextField
,FlatInternalFrame
,FlatLabel
,FlatList
,FlatMenu
,FlatMenuBar
,FlatMenuItem
,FlatPasswordField
,FlatPopupMenu
,FlatPopupMenuSeparator
,FlatProgressBar
,FlatRadioButton
,FlatRadioButtonMenuItem
,FlatScrollBar
,FlatScrollPane
,FlatSeparator
,FlatSlider
,FlatSpinner
,FlatSplitPane
,FlatTabbedPane
,FlatTable
,FlatTableHeader
,FlatTextArea
,FlatTextField
,FlatTextPane
,FlatToggleButton
,FlatToolBar
,FlatToolBarSeparator
,FlatTree
public interface FlatStyleableComponent
Interface for all styleable FlatLaf components.If you already have custom subclasses of Swing components, you can add this interface to your components to add styling getter and setter methods to them.
- Since:
- 2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Object
getClientProperty(Object key)
OverridesJComponent.getClientProperty(Object)
.default String
getStyle()
Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") ornull
if no style has been assigned.default String
getStyleClass()
Returns the style class(es) of a component (separated by space characters) ornull
if no style class has been assigned.default Map<String,Object>
getStyleMap()
Returns the style of a component asMap
<String, Object> ornull
if no style has been assigned.void
putClientProperty(Object key, Object value)
OverridesJComponent.putClientProperty(Object, Object)
.default void
setStyle(String style)
Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").default void
setStyleClass(String styleClass)
Specifies the style class(es) of a component (separated by space characters).default void
setStyleMap(Map<String,Object> styleMap)
Specifies the style of a component asMap
<String, Object> with binary values.
-
-
-
Method Detail
-
getStyle
default String getStyle()
Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") ornull
if no style has been assigned.- See Also:
FlatClientProperties.STYLE
-
setStyle
default void setStyle(String style)
Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default
Slider.thumbSize
use keythumbSize
.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 Also:
FlatClientProperties.STYLE
-
getStyleMap
default Map<String,Object> getStyleMap()
Returns the style of a component asMap
<String, Object> ornull
if no style has been assigned.- See Also:
FlatClientProperties.STYLE
-
setStyleMap
default void setStyleMap(Map<String,Object> styleMap)
Specifies the style of a component asMap
<String, Object> with binary values.The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default
Slider.thumbSize
use keythumbSize
.The values are not parsed from a string. They must be binary.
- See Also:
FlatClientProperties.STYLE
-
getStyleClass
default String getStyleClass()
Returns the style class(es) of a component (separated by space characters) ornull
if no style class has been assigned.- See Also:
FlatClientProperties.STYLE_CLASS
-
setStyleClass
default void setStyleClass(String styleClass)
Specifies the style class(es) of a component (separated by space characters).- See Also:
FlatClientProperties.STYLE_CLASS
-
getClientProperty
Object getClientProperty(Object key)
OverridesJComponent.getClientProperty(Object)
.
-
putClientProperty
void putClientProperty(Object key, Object value)
OverridesJComponent.putClientProperty(Object, Object)
.
-
-