@Tag(value="multi-click-button") public class MultiClickButton extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.button.Button> implements WithIdMixin<MultiClickButton>, ComponentClickNotifier<MultiClickButton>, Clickable, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasEnabled, HasState<ButtonState>, StateChangeNotifier<ButtonState,MultiClickButton>
| Constructor and Description |
|---|
MultiClickButton(ButtonState... states)
Creates a button with given states.
|
MultiClickButton(ComponentClickListener<MultiClickButton> listener,
ButtonState... states)
Creates a button with given listener and states.
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addClickListener(ComponentClickListener<MultiClickButton> listener)
Adds a listener.
|
com.vaadin.flow.shared.Registration |
addStateChangeListener(StateChangeListener<ButtonState,MultiClickButton> listener)
Adds given
StateChangeListener. |
void |
clear()
Removes all associated states.
|
void |
click()
Clicks this object.
|
com.vaadin.flow.component.Component |
getIcon()
Returns current icon.
|
ButtonState |
getState()
Returns the current state of this object.
|
String |
getText()
Returns currently displayed text.
|
protected com.vaadin.flow.component.button.Button |
initContent() |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
void |
setStates(ButtonState... states)
Sets the states of the button that need to be clicked one after another before the real click happens.
|
void |
setStates(Collection<ButtonState> states)
Sets the states of the button that need to be clicked one after another before the real click happens.
|
protected void |
updateButtonState(ButtonState newState)
Updates the state of the button from old to new.
|
getChildren, getContent, getElementaddListener, fireEvent, from, get, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithIdaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamegetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullpublic MultiClickButton(ButtonState... states)
states - An array of ButtonStates. Once button reaches last state, it fires click event.public MultiClickButton(ComponentClickListener<MultiClickButton> listener, ButtonState... states)
listener - Listener that will be notified once button reaches its final state and is clicked.states - An array of ButtonStates. Once button reaches last state, it fires click event.public com.vaadin.flow.shared.Registration addClickListener(ComponentClickListener<MultiClickButton> listener)
ComponentClickNotifieraddClickListener in interface ComponentClickNotifier<MultiClickButton>listener - Listener to be notified when event is fired.Registration that can be used to stop listening to the event.protected void updateButtonState(ButtonState newState)
newState - New state.public void setStates(Collection<ButtonState> states)
states - ButtonStates to use. Old states will be removed.public final void setStates(ButtonState... states)
states - ButtonStates to use. Old states will be removed.public String getText()
public com.vaadin.flow.component.Component getIcon()
public ButtonState getState()
HasStategetState in interface HasState<ButtonState>null.public void clear()
protected com.vaadin.flow.component.button.Button initContent()
initContent in class com.vaadin.flow.component.Composite<com.vaadin.flow.component.button.Button>public void click()
Clickablepublic void setEnabled(boolean enabled)
setEnabled in interface com.vaadin.flow.component.HasEnabledpublic boolean isEnabled()
isEnabled in interface com.vaadin.flow.component.HasEnabledpublic com.vaadin.flow.shared.Registration addStateChangeListener(StateChangeListener<ButtonState,MultiClickButton> listener)
StateChangeNotifierStateChangeListener.addStateChangeListener in interface StateChangeNotifier<ButtonState,MultiClickButton>listener - Listener to be notified about StateChangeEvents.Registration that can be used to stop listening to the event.Copyright © 2024 Miki. All rights reserved.