Interface ThemableLayout
-
- All Superinterfaces:
HasElement
,Serializable
- All Known Implementing Classes:
HorizontalLayout
,VerticalLayout
public interface ThemableLayout extends HasElement
Common logic forVerticalLayout
andHorizontalLayout
related to dynamic theme adjustment.Note: Dynamic adjustment have effect only if the corresponding component theme supports it.
- Author:
- Vaadin Ltd.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default BoxSizing
getBoxSizing()
Gets the box-sizing defined for the layout, orBoxSizing.UNDEFINED
if none was defined on the server-side.default ThemeList
getThemeList()
Gets the set of the theme names applied to the corresponding element intheme
attribute.default boolean
isMargin()
Shows ifmargin
theme setting is applied to the component.default boolean
isPadding()
Shows ifpadding
theme setting is applied to the component.default boolean
isSpacing()
Shows ifspacing
theme setting is applied to the component.default void
setBoxSizing(BoxSizing boxSizing)
Sets thebox-sizing
CSS property of the layout.default void
setMargin(boolean margin)
Togglesmargin
theme setting for the element.default void
setPadding(boolean padding)
Togglespadding
theme setting for the element.default void
setSpacing(boolean spacing)
Togglesspacing
theme setting for the element.-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
-
-
-
Method Detail
-
setMargin
default void setMargin(boolean margin)
Togglesmargin
theme setting for the element. If a theme supports this attribute, it will apply or remove margin to the element.- Parameters:
margin
- addsmargin
theme setting iftrue
or removes it iffalse
-
isMargin
default boolean isMargin()
Shows ifmargin
theme setting is applied to the component.- Returns:
true
if theme setting is applied,false
otherwise
-
setPadding
default void setPadding(boolean padding)
Togglespadding
theme setting for the element. If a theme supports this attribute, it will apply or remove padding to the element.- Parameters:
padding
- addspadding
theme setting iftrue
or removes it iffalse
-
isPadding
default boolean isPadding()
Shows ifpadding
theme setting is applied to the component.- Returns:
true
if theme setting is applied,false
otherwise
-
setSpacing
default void setSpacing(boolean spacing)
Togglesspacing
theme setting for the element. If a theme supports this attribute, it will apply or remove spacing to the element.This method adds medium spacing to the component theme, to set other options, use
getThemeList()
. List of options possible:- spacing-xs
- spacing-s
- spacing
- spacing-l
- spacing-xl
- Parameters:
spacing
- addsspacing
theme setting iftrue
or removes it iffalse
-
isSpacing
default boolean isSpacing()
Shows ifspacing
theme setting is applied to the component.- Returns:
true
if theme setting is applied,false
otherwise
-
getThemeList
default ThemeList getThemeList()
Gets the set of the theme names applied to the corresponding element intheme
attribute. The set returned can be modified to add or remove the theme names, changes to the set will be reflected in the attribute value.Despite the name implying a list being returned, the return type is actually a
Set
since the in-browser return value behaves like aSet
in Java.- Returns:
- a list of theme names, never
null
-
setBoxSizing
default void setBoxSizing(BoxSizing boxSizing)
Sets thebox-sizing
CSS property of the layout.- Parameters:
boxSizing
- the box-sizing of the layout.null
is interpreted asBoxSizing.UNDEFINED
- See Also:
BoxSizing
-
getBoxSizing
default BoxSizing getBoxSizing()
Gets the box-sizing defined for the layout, orBoxSizing.UNDEFINED
if none was defined on the server-side.- Returns:
- the box-sizing, never
null
- See Also:
BoxSizing
-
-