public class SimpleButtonState extends Object implements ButtonState, WithComponentAsIconMixin<SimpleButtonState>, WithTextMixin<SimpleButtonState>
| Constructor and Description |
|---|
SimpleButtonState()
Creates a completely blank state.
|
SimpleButtonState(com.vaadin.flow.component.Component icon,
String... classNames)
Creates button state with corresponding icon.
|
SimpleButtonState(String text,
com.vaadin.flow.component.Component icon,
String... classNames)
Creates button state.
|
SimpleButtonState(String text,
String... classNames)
Creates button state with corresponding text.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassName(String... classNames)
Adds given style class names to this state.
|
void |
addThemeName(String... themeNames)
Adds given theme names to this state.
|
void |
addThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
Adds given theme variants to this state.
|
ButtonState |
copy()
Returns a deep copy of this object.
|
static List<ButtonState> |
forTexts(String... texts)
Turns given texts into corresponding
ButtonStates, one for each text. |
Set<String> |
getClassNames()
Returns current (ordered) set of style class names associated with this state.
|
com.vaadin.flow.component.Component |
getIcon()
Returns current icon of the button.
|
String |
getText()
Returns current text of the button.
|
Set<String> |
getThemeNames()
Returns current (ordered) set of theme names associated with this state.
|
Set<com.vaadin.flow.component.button.ButtonVariant> |
getThemeVariants()
Returns current (ordered) set of theme variants associated with this state.
|
void |
removeClassName(String... classNames)
Removes given style class names from this state.
|
void |
removeThemeName(String... themeNames)
Removes given theme names from this state.
|
void |
removeThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
Removes given theme variants from this state.
|
void |
setIcon(com.vaadin.flow.component.Component icon)
Sets given
Component as an icon of this object. |
void |
setText(String text)
Sets text of this object.
|
SimpleButtonState |
withClassName(String... classNames)
Chains
addClassName(String...) and returns itself. |
SimpleButtonState |
withoutClassName(String... classNames)
Chains
removeClassName(String...) and returns itself. |
SimpleButtonState |
withoutThemeName(String... themeNames)
Chains
removeThemeName(String...) and returns itself. |
SimpleButtonState |
withoutThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
Chains
removeThemeVariant(ButtonVariant...) and returns itself. |
SimpleButtonState |
withThemeName(String... themeNames)
Chains
addThemeName(String...) and returns itself. |
SimpleButtonState |
withThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
Chains
addThemeVariant(ButtonVariant...) and returns itself. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitofwithIconwithTextpublic SimpleButtonState()
public SimpleButtonState(String text, String... classNames)
text - Text.classNames - Optional style class names associated with this state.public SimpleButtonState(com.vaadin.flow.component.Component icon,
String... classNames)
icon - A Component to use as an icon.classNames - Optional style class names associated with this state.public static List<ButtonState> forTexts(String... texts)
ButtonStates, one for each text.texts - Texts to produce ButtonStates for.ButtonStates.public String getText()
ButtonStategetText in interface HasTextgetText in interface ButtonStatepublic void setText(String text)
HasTextpublic com.vaadin.flow.component.Component getIcon()
ButtonStategetIcon in interface HasComponentAsIcongetIcon in interface ButtonStatepublic void setIcon(com.vaadin.flow.component.Component icon)
HasComponentAsIconComponent as an icon of this object.setIcon in interface HasComponentAsIconicon - A Component to be used as an icon. Can be null to clear current icon.public void addClassName(String... classNames)
classNames - Style class names to be associated with this state. If a style class name already exists, it is ignored.public void removeClassName(String... classNames)
classNames - Style class names to be removed from this state. If a style class name is not present, nothing happens.public Set<String> getClassNames()
ButtonStategetClassNames in interface ButtonStatepublic SimpleButtonState withClassName(String... classNames)
addClassName(String...) and returns itself.classNames - Style class names to add.public SimpleButtonState withoutClassName(String... classNames)
removeClassName(String...) and returns itself.classNames - Style class names to remove.public void addThemeName(String... themeNames)
themeNames - Theme names to be associated with this state. If a theme name already exists, it is ignored.public void removeThemeName(String... themeNames)
themeNames - Theme names to be removed from this state. If a theme name is not present, nothing happens.public Set<String> getThemeNames()
ButtonStategetThemeNames in interface ButtonStatepublic SimpleButtonState withThemeName(String... themeNames)
addThemeName(String...) and returns itself.themeNames - Theme names to add.public SimpleButtonState withoutThemeName(String... themeNames)
removeThemeName(String...) and returns itself.themeNames - Names to remove.public void addThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
variants - Theme variants to be associated with this state. If a theme variant already exists, it is ignored.public void removeThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
variants - Theme variants to be removed from this state. If a variant is not present, nothing happens.public Set<com.vaadin.flow.component.button.ButtonVariant> getThemeVariants()
ButtonStategetThemeVariants in interface ButtonStatepublic SimpleButtonState withThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
addThemeVariant(ButtonVariant...) and returns itself.variants - Variants to add.public SimpleButtonState withoutThemeVariant(com.vaadin.flow.component.button.ButtonVariant... variants)
removeThemeVariant(ButtonVariant...) and returns itself.variants - Variants to remove.public ButtonState copy()
Copyright © 2024 Miki. All rights reserved.