Class MultiClickButton

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.vaadin.flow.shared.Registration addClickListener​(ComponentClickListener<MultiClickButton> listener)
      Adds a listener.
      com.vaadin.flow.shared.Registration addStateChangeListener​(StateChangeListener<ButtonState,​MultiClickButton> listener)
      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​(Collection<ButtonState> states)
      Sets the states of the button that need to be clicked one after another before the real click happens.
      void setStates​(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.
      • Methods inherited from class com.vaadin.flow.component.Composite

        getChildren, getContent, getElement
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

        addAttachListener
      • Methods inherited from interface com.vaadin.flow.component.DetachNotifier

        addDetachListener
      • Methods inherited from interface com.vaadin.flow.component.HasElement

        getElement
      • Methods inherited from interface com.vaadin.flow.component.HasSize

        getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
      • Methods inherited from interface com.vaadin.flow.component.HasStyle

        addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
    • Constructor Detail

      • MultiClickButton

        public MultiClickButton​(ButtonState... states)
        Creates a button with given states.
        Parameters:
        states - An array of ButtonStates. Once button reaches last state, it fires click event.
      • MultiClickButton

        public MultiClickButton​(ComponentClickListener<MultiClickButton> listener,
                                ButtonState... states)
        Creates a button with given listener and states.
        Parameters:
        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.
    • Method Detail

      • updateButtonState

        protected void updateButtonState​(ButtonState newState)
        Updates the state of the button from old to new.
        Parameters:
        newState - New state.
      • setStates

        public void setStates​(Collection<ButtonState> states)
        Sets the states of the button that need to be clicked one after another before the real click happens.
        Parameters:
        states - ButtonStates to use. Old states will be removed.
      • setStates

        public final void setStates​(ButtonState... states)
        Sets the states of the button that need to be clicked one after another before the real click happens.
        Parameters:
        states - ButtonStates to use. Old states will be removed.
      • getText

        public String getText()
        Returns currently displayed text.
        Returns:
        Currently displayed text.
      • getIcon

        public com.vaadin.flow.component.Component getIcon()
        Returns current icon.
        Returns:
        Current icon.
      • getState

        public ButtonState getState()
        Description copied from interface: HasState
        Returns the current state of this object. The changes to the resulting object should not affect this object.
        Specified by:
        getState in interface HasState<ButtonState>
        Returns:
        Current state. May never be null.
      • clear

        public void clear()
        Removes all associated states.
      • initContent

        protected com.vaadin.flow.component.button.Button initContent()
        Overrides:
        initContent in class com.vaadin.flow.component.Composite<com.vaadin.flow.component.button.Button>
      • click

        public void click()
        Description copied from interface: Clickable
        Clicks this object. What it means is left for implementations to figure out.
        Specified by:
        click in interface Clickable
      • setEnabled

        public void setEnabled​(boolean enabled)
        Specified by:
        setEnabled in interface com.vaadin.flow.component.HasEnabled
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.vaadin.flow.component.HasEnabled