Class WhatsappButton

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

@Tag("fc-whatsapp-button") @NpmPackage(value="@flowingcode/fc-whatsapp-button", version="2.1.0") @JsModule("@flowingcode/fc-whatsapp-button/dist/src/fc-whatsapp-button.js") public class WhatsappButton extends Component
See Also:
  • 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:
      inviteCode - 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:
      responsive - true to enable responsive option
    • 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:
      dialog - true to enable dialog option