Package de.esoco.process.ui.style
Klasse UiStyle
Contains properties that define the style of a
UiComponent
.-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal UiStyle
addStyleName
(String additionalName) Adds a style name to the current style name.static String
addStyleName
(String styleName, String additionalName) Adds an additional style name to an existing style name and returns the corresponding string.void
applyPropertiesTo
(UiComponent<?, ?> component) Applies the properties of this element to the given component.final UiStyle
backgroundColor
(de.esoco.lib.property.Color color) Sets the background color.final UiStyle
Sets the component border.final UiStyle
Applies a CSS property.final UiStyle
Sets a CSS style property for the parameter.final UiStyle
defaultStyleName
(String styleName) Sets the default style name that should always be applied.final UiStyle
Sets the font size.final UiStyle
fontWeight
(String weight) Sets the font weight.foregroundColor
(de.esoco.lib.property.Color color) Sets the foreground color.final String
Returns the style name(s) of a component.final UiStyle
lineHeight
(int height, SizeUnit unit) Sets the height of a text line in the component.final UiStyle
Sets the component margin.final UiStyle
Sets the component padding.final UiStyle
Sets the style name.final UiStyle
textAlign
(de.esoco.lib.property.Alignment textAlignment) Sets the horizontal alignment of text in the component.Von Klasse geerbte Methoden de.esoco.process.ui.UiElement
applyTo, clearProperties, copyPropertiesFrom, get, get, hasProperty, isModified, set, set, set, setModified, toString
-
Konstruktordetails
-
UiStyle
public UiStyle()Creates an empty instance. -
UiStyle
Creates a new instance from an existing style.- Parameter:
style
- The style to copy the properties from
-
-
Methodendetails
-
addStyleName
Adds an additional style name to an existing style name and returns the corresponding string.- Parameter:
styleName
- The existing style name (NULL or empty for none)additionalName
- The style name to add- Gibt zurück:
- The resulting style name (may be empty but will never be NULL)
-
addStyleName
Adds a style name to the current style name.- Parameter:
additionalName
- The style name to add- Gibt zurück:
- This instance for fluent invocation
-
applyPropertiesTo
Applies the properties of this element to the given component. Will only be invoked if the properties have changed.- Setzt außer Kraft:
applyPropertiesTo
in KlasseUiElement<UiStyle>
- Parameter:
component
- The target component
-
backgroundColor
Sets the background color.- Parameter:
color
- The HTML color string- Gibt zurück:
- This instance for fluent invocation
-
border
Sets the component border.- Parameter:
border
- The HTML border definition string- Gibt zurück:
- This instance for fluent invocation
-
css
Sets a CSS style property for the parameter. The names of multi-word CSS properties must be given in CamelCase form without hyphens, starting with a lower case letter (e.g. 'font-size' must be set as 'fontSize').This method is optimized to ignore NULL values if the property doesn't exist already. Therefore invoking code doesn't need to perform null checks to prevent adding empty CSS values (e.g. from NULL-initialized variables).
- Parameter:
propertyName
- The name of the CSS propertyvalue
- The value of the CSS property or NULL to clear- Gibt zurück:
- This instance for fluent invocation
-
css
Applies a CSS property.- Parameter:
propertyName
- The name of the CSS property to applyvalue
- The property value to apply or NULL to clear- Gibt zurück:
- This instance for fluent invocation
-
defaultStyleName
Sets the default style name that should always be applied. The style name can consist of multiple words that are separated by spaces.- Parameter:
styleName
- The new default style name- Gibt zurück:
- This instance for fluent invocation
-
fontSize
Sets the font size.- Parameter:
size
- The size valueunit
- The size unit- Gibt zurück:
- This instance for fluent invocation
-
fontWeight
Sets the font weight.- Parameter:
weight
- The font weight HTML value- Gibt zurück:
- This instance for fluent invocation
-
foregroundColor
Sets the foreground color.- Parameter:
color
- The HTML color string- Gibt zurück:
- This instance for fluent invocation
-
getStyleName
Returns the style name(s) of a component.- Gibt zurück:
- The style name (empty string for none)
-
lineHeight
Sets the height of a text line in the component.- Parameter:
height
- The height valueunit
- The height unit- Gibt zurück:
- This instance for fluent invocation
-
margin
Sets the component margin.- Parameter:
margin
- padding The HTML margin definition string- Gibt zurück:
- This instance for fluent invocation
-
padding
Sets the component padding.- Parameter:
padding
- The HTML padding definition string- Gibt zurück:
- This instance for fluent invocation
-
styleName
Sets the style name. The style name can consist of multiple words that are separated by spaces.- Parameter:
styleName
- The style name- Gibt zurück:
- This instance for fluent invocation
-
textAlign
Sets the horizontal alignment of text in the component.- Parameter:
textAlignment
- The horizontal text alignment- Gibt zurück:
- This instance for fluent invocation
-