Class WhatsappButton

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, java.io.Serializable

    @Tag("fc-whatsapp-button")
    @NpmPackage(value="@flowingcode/fc-whatsapp-button",
                version="1.0.3")
    @JsModule("@flowingcode/fc-whatsapp-button/dist/src/fc-whatsapp-button.js")
    public class WhatsappButton
    extends com.vaadin.flow.component.Component
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      WhatsappButton()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDialCode()
      Returns the dial code.
      java.lang.String getInviteCode()
      Returns an invite code.
      java.lang.String getLabel()
      Returns the button's label.
      java.lang.String getPhone()
      Returns the phone number.
      java.lang.String getText()
      Returns the message text.
      boolean isLeadingIcon()
      Returns whether the button's icon is leading or not.
      boolean isRedirect()
      Returns whether redirect is enabled or not.
      boolean isResponsive()
      Returns whether responsive is enabled or not.
      boolean isShowDialog()
      Returns whether dialog should be shown on button click.
      void setDialCode​(java.lang.String dialCode)
      Sets a dial code number.
      void setInviteCode​(java.lang.String inviteCode)
      Sets an invite code.
      void setLabel​(java.lang.String label)
      Sets the button's label.
      void setLeadingIcon​(boolean leading)
      Sets if button's icon should be in leading position or not.
      void setPhone​(java.lang.String phone)
      Sets a phone number.
      void setRedirect​(boolean redirect)
      Sets redirect option.
      void setResponsive​(boolean responsive)
      Sets responsive option.
      void setShowDialog​(boolean dialog)
      Sets dialog option.
      void setText​(java.lang.String text)
      Sets the message text to display.
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

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

        addDetachListener
    • Constructor Detail

      • WhatsappButton

        public WhatsappButton()
    • Method Detail

      • getPhone

        public java.lang.String getPhone()
        Returns the phone number.
        Returns:
        String return the phone number
      • setPhone

        public void setPhone​(java.lang.String phone)
        Sets a phone number.
        Parameters:
        phone - the phone number to set
      • getDialCode

        public java.lang.String getDialCode()
        Returns the dial code.
        Returns:
        String return the dialCode
      • setDialCode

        public void setDialCode​(java.lang.String dialCode)
        Sets a dial code number.
        Parameters:
        dialCode - the dialCode to set
      • getLabel

        public java.lang.String getLabel()
        Returns the button's label.
        Returns:
        String return the label
      • setLabel

        public void setLabel​(java.lang.String label)
        Sets the button's label. Default value is "Let's chat".
        Parameters:
        label - the label to set
      • getText

        public java.lang.String getText()
        Returns the message text.
        Returns:
        String return the text
      • setInviteCode

        public void setInviteCode​(java.lang.String inviteCode)
        Sets an invite code.
        Parameters:
        invite - code the invite code to set
      • getInviteCode

        public java.lang.String getInviteCode()
        Returns an invite code.
        Returns:
        String return the invite code
      • setText

        public void setText​(java.lang.String text)
        Sets the message text to display. Default value is "Hi!".
        Parameters:
        text - the message text to set
      • isLeadingIcon

        public boolean isLeadingIcon()
        Returns whether the button's icon is leading or not.
        Returns:
        boolean true if icon is leading
      • setLeadingIcon

        public void setLeadingIcon​(boolean leading)
        Sets if button's icon should be in leading position or not. By default icon is trailing.
        Parameters:
        leading - true to enable leading
      • isRedirect

        public boolean isRedirect()
        Returns whether redirect is enabled or not.
        Returns:
        boolean the redirect value
      • setRedirect

        public void setRedirect​(boolean redirect)
        Sets redirect option. This value should be true when button is use in not mobile devices.
        Parameters:
        redirect - true to enable redirect
      • isResponsive

        public boolean isResponsive()
        Returns whether responsive is enabled or not.
        Returns:
        boolean the responsive value
      • setResponsive

        public void setResponsive​(boolean responsive)
        Sets responsive option.
        Parameters:
        redirect - true to enable redirect
      • isShowDialog

        public boolean isShowDialog()
        Returns whether dialog should be shown on button click.
        Returns:
        boolean the show dialog value
      • setShowDialog

        public void setShowDialog​(boolean dialog)
        Sets dialog option. If true, a dialog will show on button click indicating whatsapp is opening.
        Parameters:
        redirect - true to enable redirect