Package com.vaadin.flow.component
Interface HasTheme
- All Superinterfaces:
HasElement,Serializable
- All Known Subinterfaces:
HasThemeVariant<TVariantEnum>
- All Known Implementing Classes:
AccordionPanel,Avatar,AvatarGroup,BigDecimalField,Button,Card,Chart,CheckboxGroup,CollaborationAvatarGroup,ComboBox,ComboBoxBase,Crud,CrudGrid,CustomField,Dashboard,DatePicker,DateTimePicker,Details,Dialog,DrawerToggle,EmailField,Grid,GridPro,IntegerField,Map,MapBase,MenuBar,MultiSelectComboBox,Notification,NumberField,PasswordField,Popover,ProgressBar,RadioButtonGroup,RichTextEditor,Scroller,Select,SplitLayout,Tab,Tabs,TabSheet,TextArea,TextField,TimePicker,TreeGrid
Represents
Component which has theme attribute.
Implementation of HasElement.getElement() may return any type of element.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddThemeName(String themeName) Adds a theme name to this component.default voidaddThemeNames(String... themeNames) Adds one or more theme names to this component.default StringGets the theme names for this component.default ThemeListGets 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 Details
-
addThemeName
Adds a theme name to this component.- Parameters:
themeName- the theme name to add, notnull
-
removeThemeName
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
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
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
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:
-
setThemeName
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
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
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
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
-