public interface ThemableLayout extends HasElement
VerticalLayout
and HorizontalLayout
related
to dynamic theme adjustment.
Note: Dynamic adjustment have effect only if the corresponding component theme supports it.
Modifier and Type | Method and Description |
---|---|
default BoxSizing |
getBoxSizing()
Gets the box-sizing defined for the layout, or
BoxSizing.UNDEFINED if none was defined on the server-side. |
default ThemeList |
getThemeList()
Gets the set of the theme names applied to the corresponding element in
theme attribute. |
default boolean |
isMargin()
Shows if
margin theme setting is applied to the component. |
default boolean |
isPadding()
Shows if
padding theme setting is applied to the component. |
default boolean |
isSpacing()
Shows if
spacing theme setting is applied to the component. |
default void |
setBoxSizing(BoxSizing boxSizing)
Sets the
box-sizing CSS property of the layout. |
default void |
setMargin(boolean margin)
Toggles
margin theme setting for the element. |
default void |
setPadding(boolean padding)
Toggles
padding theme setting for the element. |
default void |
setSpacing(boolean spacing)
Toggles
spacing theme setting for the element. |
getElement
default void setMargin(boolean margin)
margin
theme setting for the element. If a theme supports
this attribute, it will apply or remove margin to the element.margin
- adds margin
theme setting if true
or removes
it if false
default boolean isMargin()
margin
theme setting is applied to the component.true
if theme setting is applied, false
otherwisedefault void setPadding(boolean padding)
padding
theme setting for the element. If a theme
supports this attribute, it will apply or remove padding to the element.padding
- adds padding
theme setting if true
or removes
it if false
default boolean isPadding()
padding
theme setting is applied to the component.true
if theme setting is applied, false
otherwisedefault void setSpacing(boolean spacing)
spacing
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
- adds spacing
theme setting if true
or removes
it if false
default boolean isSpacing()
spacing
theme setting is applied to the component.true
if theme setting is applied, false
otherwisedefault ThemeList getThemeList()
theme
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 a
Set
in Java.
null
default void setBoxSizing(BoxSizing boxSizing)
box-sizing
CSS property of the layout.boxSizing
- the box-sizing of the layout. null
is interpreted
as BoxSizing.UNDEFINED
BoxSizing
default BoxSizing getBoxSizing()
BoxSizing.UNDEFINED
if none was defined on the server-side.null
BoxSizing
Copyright © 2019. All rights reserved.