Package com.vaadin.flow.component
Interface HasTheme
-
- All Superinterfaces:
HasElement,Serializable
- All Known Subinterfaces:
HasThemeVariant<TVariantEnum>
- All Known Implementing Classes:
AbstractNumberField,AccordionPanel,Avatar,AvatarGroup,BigDecimalField,Button,Chart,CheckboxGroup,CollaborationAvatarGroup,ComboBox,ComboBoxBase,Crud,CrudGrid,CustomField,DatePicker,DateTimePicker,Details,Dialog,DrawerToggle,EmailField,GeneratedVaadinButton,GeneratedVaadinCheckboxGroup,GeneratedVaadinProgressBar,GeneratedVaadinRadioGroup,GeneratedVaadinRichTextEditor,GeneratedVaadinSplitLayout,GeneratedVaadinTab,GeneratedVaadinTabs,Grid,GridPro,IntegerField,Map,MapBase,MenuBar,MultiSelectComboBox,Notification,NumberField,PasswordField,ProgressBar,RadioButtonGroup,RichTextEditor,Select,SplitLayout,Tab,Tabs,TabSheet,TextArea,TextField,TimePicker,TreeGrid
public interface HasTheme extends HasElement
RepresentsComponentwhich has theme attribute.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidaddThemeName(String themeName)Adds a theme name to this component.default voidaddThemeNames(String... themeNames)Adds one or more theme names to this component.default StringgetThemeName()Gets the theme names for this component.default ThemeListgetThemeNames()Gets the set of theme names used for this element.default booleanhasThemeName(String themeName)Checks if the component has the given theme name.default booleanremoveThemeName(String themeName)Removes a theme name from this component.default voidremoveThemeNames(String... themeNames)Removes one or more theme names from component.default voidsetThemeName(String themeName)Sets the theme names of this component.default voidsetThemeName(String themeName, boolean set)Sets or removes the given theme name for this component.-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
-
-
-
Method Detail
-
addThemeName
default void addThemeName(String themeName)
Adds a theme name to this component.- Parameters:
themeName- the theme name to add, notnull
-
removeThemeName
default boolean removeThemeName(String themeName)
Removes a theme name from this component.- Parameters:
themeName- the theme name to remove, notnull- Returns:
trueif the theme name was removed,falseif the theme list didn't contain the theme name
-
setThemeName
default void setThemeName(String themeName)
Sets the theme names of this component. This method overwrites any previous set theme names.- Parameters:
themeName- a space-separated string of theme names to set, or empty string to remove all theme names
-
getThemeName
default String getThemeName()
Gets the theme names for this component.- Returns:
- a space-separated string of theme names, empty string if there
are no theme names or
nullif attribute (theme) is not set at all
-
getThemeNames
default ThemeList getThemeNames()
Gets the set of theme names used for this element. The returned set can be modified to add or remove theme names. The contents of the set is also reflected in the value of thethemeattribute.- Returns:
- a list of theme names, never
null - See Also:
Element.getThemeList()
-
setThemeName
default void setThemeName(String themeName, boolean set)
Sets or removes the given theme name for this component.- Parameters:
themeName- the theme name to set or remove, notnullset-trueto set the theme name,falseto remove it
-
hasThemeName
default boolean hasThemeName(String themeName)
Checks if the component has the given theme name.- Parameters:
themeName- the theme name to check for- Returns:
trueif the component has the given theme name,falseotherwise
-
addThemeNames
default void addThemeNames(String... themeNames)
Adds one or more theme names to this component. Multiple theme names can be specified by using multiple parameters.- Parameters:
themeNames- the theme name or theme names to be added to the component
-
removeThemeNames
default void removeThemeNames(String... themeNames)
Removes one or more theme names from component. Multiple theme names can be specified by using multiple parameters.- Parameters:
themeNames- the theme name or theme names to be removed from the component
-
-