Class WhatsappButton

java.lang.Object
com.vaadin.flow.component.Component
com.flowingcode.vaadin.addons.whatsappbutton.WhatsappButton
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the dial code.
    Returns an invite code.
    Returns the button's label.
    Returns the phone number.
    Returns the message text.
    boolean
    Returns whether the button's icon is leading or not.
    boolean
    Returns whether redirect is enabled or not.
    boolean
    Returns whether responsive is enabled or not.
    boolean
    Returns whether dialog should be shown on button click.
    void
    setDialCode(String dialCode)
    Sets a dial code number.
    void
    setInviteCode(String inviteCode)
    Sets an invite code.
    void
    Sets the button's label.
    void
    setLeadingIcon(boolean leading)
    Sets if button's icon should be in leading position or not.
    void
    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
    Sets the message text to display.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, 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

    Methods inherited from interface com.vaadin.flow.component.HasStyle

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

    • WhatsappButton

      public WhatsappButton()
  • Method Details

    • getPhone

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

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

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

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

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

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

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

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

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

      public void setText(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