- 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 boolean
add(String style)
boolean
contains(String style)
String
get()
This method gets the style(s) (also called style-name(s)) of this object.String
getPrimary()
protected void
onStylesChanged()
Triggered whenever thestyles
changed.boolean
remove(String style)
void
set(String styles)
void
setPrimary(String primaryStyle)
String
toString()
-
-
-
Method Detail
-
get
public final String get()
Description copied from interface:UiStyles
This 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 theclass
attribute 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 thestyles
changed.
-
contains
public final boolean contains(String style)
-
add
public final boolean add(String style)
-
remove
public final boolean remove(String style)
- Specified by:
remove
in interfaceUiStyles
- Parameters:
style
- is the style to remove. If this style is not contained in thestyles
, this will have no effect.- Returns:
true
if the givenstyle
has actually been removed,false
otherwise (if itwas not present
).
-
getPrimary
public final String getPrimary()
- Specified by:
getPrimary
in interfaceUiStyles
- Returns:
- the primary style of this widget. Will be
null
if not defined.
-
setPrimary
public final void setPrimary(String primaryStyle)
- Specified by:
setPrimary
in interfaceUiStyles
- Parameters:
primaryStyle
- is the new value ofUiStyles.getPrimary()
.
-
-