- java.lang.Object
-
- io.github.mmm.ui.spi.UiStylesImpl
-
-
Field Summary
-
Fields inherited from interface io.github.mmm.ui.api.datatype.UiStyles
PATTERN_MULTIPLE, PATTERN_SINGLE
-
-
Constructor Summary
Constructors Constructor Description UiStylesImpl()The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(String style)booleancontains(String style)Stringget()This method gets the style(s) (also called style-name(s)) of this object.StringgetPrimary()protected voidonStylesChanged()Triggered whenever thestyleschanged.booleanremove(String style)voidset(String styles)voidsetPrimary(String primaryStyle)StringtoString()
-
-
-
Method Detail
-
get
public final String get()
Description copied from interface:UiStylesThis method gets the style(s) (also called style-name(s)) of this object. The style defines aspects for the appearance (look & feel) of a UI element when displayed to the user.
If you are familiar with web-technology just think of this as theclassattribute of HTML elements that are then configured via some cascading style sheet (CSS).
The following situations can be distinguished:- no style
The empty string is returned. - single style
The name of that single style is returned. The result does NOT contain any whitespace. - multiple styles
The list of individual styles are separated by whitespaces in the result.
UiStyles.PATTERN_SINGLE. Any number of styles or in other words the result of this has to matchUiStyles.PATTERN_MULTIPLE. The first style is called theprimary style. - no style
-
set
public final void set(String styles)
-
onStylesChanged
protected void onStylesChanged()
Triggered whenever thestyleschanged.
-
contains
public final boolean contains(String style)
-
add
public final boolean add(String style)
-
remove
public final boolean remove(String style)
- Specified by:
removein interfaceUiStyles- Parameters:
style- is the style to remove. If this style is not contained in thestyles, this will have no effect.- Returns:
trueif the givenstylehas actually been removed,falseotherwise (if itwas not present).
-
getPrimary
public final String getPrimary()
- Specified by:
getPrimaryin interfaceUiStyles- Returns:
- the primary style of this widget. Will be
nullif not defined.
-
setPrimary
public final void setPrimary(String primaryStyle)
- Specified by:
setPrimaryin interfaceUiStyles- Parameters:
primaryStyle- is the new value ofUiStyles.getPrimary().
-
-