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,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.StringgetDialCode()Returns the dial code.java.lang.StringgetInviteCode()Returns an invite code.java.lang.StringgetLabel()Returns the button's label.java.lang.StringgetPhone()Returns the phone number.java.lang.StringgetText()Returns the message text.booleanisLeadingIcon()Returns whether the button's icon is leading or not.booleanisRedirect()Returns whether redirect is enabled or not.booleanisResponsive()Returns whether responsive is enabled or not.booleanisShowDialog()Returns whether dialog should be shown on button click.voidsetDialCode(java.lang.String dialCode)Sets a dial code number.voidsetInviteCode(java.lang.String inviteCode)Sets an invite code.voidsetLabel(java.lang.String label)Sets the button's label.voidsetLeadingIcon(boolean leading)Sets if button's icon should be in leading position or not.voidsetPhone(java.lang.String phone)Sets a phone number.voidsetRedirect(boolean redirect)Sets redirect option.voidsetResponsive(boolean responsive)Sets responsive option.voidsetShowDialog(boolean dialog)Sets dialog option.voidsetText(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
-
-
-
-
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
-
-