public interface UiStyles
Container for styles.
-
Field Details
-
PATTERN_SINGLE
The regular expression pattern for a single style.- See Also:
-
PATTERN_MULTIPLE
The regular expression pattern for any number ofstyles
.- See Also:
-
-
Method Details
-
get
String get()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.
PATTERN_SINGLE
. Any number of styles or in other words the result of this has to matchPATTERN_MULTIPLE
. The first style is called theprimary style
.- Returns:
- the style(s) of this object.
- no style
-
set
- Parameters:
styles
- the newstyles
. Either a single style or a list of styles separated by whitespaces. Use the empty string to unset all styles.
-
contains
- Parameters:
style
- is the style to check.- Returns:
true
if the givenstyle
is present in thestyles
,false
otherwise.
-
add
- Parameters:
style
- is the style to add. If this style is already contained in thestyles
, this will have no effect.- Returns:
true
if the style has actually been added,false
if it was already present before.
-
remove
- 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
String getPrimary()- Returns:
- the primary style of this widget. Will be
null
if not defined.
-
setPrimary
- Parameters:
primaryStyle
- is the new value ofgetPrimary()
.
-