Package com.vaadin.flow.dom
Interface Style
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicElementStyle
,ImmutableEmptyStyle
Provides inline styles for
Element
s.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static enum
Css values for the clear property.static enum
static enum
Css values for the float property.static enum
static enum
Css values for the position property.static enum
Css values for the text-align property.static enum
Css values for the visibility property.static enum
Css values for the white-space property. -
Method Summary
Modifier and TypeMethodDescriptionclear()
Removes all set style properties.Gets the value of the given style property.getNames()
Gets the defined style property names.boolean
Checks if the given style property has been set.Removes the given style property if it has been set.Sets the given style property to the given value.default Style
setBackground
(String value) Sets thebackground
property.default Style
Sets theborder
property.default Style
Sets thebottom
property.default Style
setBoxShadow
(String value) Sets thebox-shadow
property.default Style
setBoxSizing
(Style.BoxSizing value) Sets thebox-sizing
property.default Style
setClear
(Style.Clear value) Sets theclear
property.default Style
Sets thecolor
property.default Style
Sets thecursor
property.default Style
setDisplay
(Style.Display value) Sets thedisplay
property.default Style
setFloat
(Style.FloatCss value) Sets thefloat
property.default Style
Sets thefont
property.default Style
Sets theheight
property.default Style
Sets theleft
property.default Style
Sets themargin
property.default Style
setOpacity
(String value) Sets theopacity
property.default Style
setOutline
(String value) Sets theoutline
property.default Style
setOverflow
(Style.Overflow value) Sets theoverflow
property.default Style
setPadding
(String value) Sets thepadding
property.default Style
setPosition
(Style.Position value) Sets theposition
property.default Style
Sets theright
property.default Style
Sets thescale
property.default Style
setTextAlign
(Style.TextAlign value) Sets thetext-align
property.default Style
setTextDecoration
(String value) Sets thetext-decoration
property.default Style
Sets thetop
property.default Style
setTransform
(String value) Sets thetransform
property.default Style
setTransition
(String value) Sets thetransition
property.default Style
setVisibility
(Style.Visibility value) Sets thevisibility
property.default Style
setWhiteSpace
(Style.WhiteSpace value) Sets thewhite-space
property.default Style
Sets thewidth
property.default Style
Sets thez-index
property.
-
Method Details
-
get
Gets the value of the given style property.Note that the name should be in camelCase and not dash-separated, i.e. use "fontFamily" and not "font-family"
- Parameters:
name
- the style property name as camelCase, notnull
- Returns:
- the style property value, or
null
if the style property has not been set
-
set
Sets the given style property to the given value.Both camelCased (e.g.
fontFamily
) and dash-separated (e.g.font-family
versions are supported.- Parameters:
name
- the style property name as camelCase, notnull
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
remove
Removes the given style property if it has been set.Both camelCased (e.g.
fontFamily
) and dash-separated (e.g.font-family
versions are supported.- Parameters:
name
- the style property name as camelCase, notnull
- Returns:
- this style instance
-
clear
Style clear()Removes all set style properties.- Returns:
- this style instance
-
has
Checks if the given style property has been set.Both camelCased (e.g.
fontFamily
) and dash-separated (e.g.font-family
versions are supported.- Parameters:
name
- the style property name as camelCase, notnull
- Returns:
true
if the style property has been set,false
otherwise
-
getNames
Gets the defined style property names.Note that this always returns the name as camelCased, e.g.
fontFamily
even if it has been set as dash-separated (font-family
).- Returns:
- a stream of defined style property names
-
setBackground
Sets thebackground
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorder
Sets theborder
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBoxSizing
Sets thebox-sizing
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBoxShadow
Sets thebox-shadow
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setClear
Sets theclear
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setCursor
Sets thecursor
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setColor
Sets thecolor
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setDisplay
Sets thedisplay
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFloat
Sets thefloat
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFont
Sets thefont
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setHeight
Sets theheight
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMargin
Sets themargin
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOutline
Sets theoutline
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOpacity
Sets theopacity
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOverflow
Sets theoverflow
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPadding
Sets thepadding
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPosition
Sets theposition
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setScale
Sets thescale
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTextAlign
Sets thetext-align
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTextDecoration
Sets thetext-decoration
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTransform
Sets thetransform
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTransition
Sets thetransition
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setVisibility
Sets thevisibility
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setWidth
Sets thewidth
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setWhiteSpace
Sets thewhite-space
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setLeft
Sets theleft
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setRight
Sets theright
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTop
Sets thetop
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBottom
Sets thebottom
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setZIndex
Sets thez-index
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-