Skip to content

Commit

Permalink
docs: add missing javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
paodb committed Mar 7, 2023
1 parent c848077 commit d43edd8
Showing 1 changed file with 68 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,97 +34,164 @@ public class WhatsappButton extends Component {
public WhatsappButton() {}

/**
* Returns the phone number.
*
* @return String return the phone number
*/
public String getPhone() {
return this.getElement().getProperty("phone");
}

/**
* Sets a phone number.
*
* @param phone the phone number to set
*/
public void setPhone(String phone) {
this.getElement().setProperty("phone", phone);
}

/**
* Returns the dial code.
*
* @return String return the dialCode
*/
public String getDialCode() {
return this.getElement().getProperty("dialcode");
}

/**
* Sets a dial code number.
*
* @param dialCode the dialCode to set
*/
public void setDialCode(String dialCode) {
this.getElement().setProperty("dialcode", dialCode);
}

/**
* Returns the button's label.
*
* @return String return the label
*/
public String getLabel() {
return this.getElement().getProperty("label");
}

/**
* Sets the button's label. Default value is "Let's chat".
*
* @param label the label to set
*/
public void setLabel(String label) {
this.getElement().setProperty("label", label);
}

/**
* Returns the message text.
*
* @return String return the text
*/
public String getText() {
return this.getElement().getProperty("text");
}

/**
* @param text the text to set
* Sets an invite code.
*
* @param invite code the invite code to set
*/
public void setInviteCode(String inviteCode) {
this.getElement().setProperty("invitecode", inviteCode);
}

/**
* Returns an invite code.
*
* @return String return the invite code
*/
public String getInviteCode() {
return this.getElement().getProperty("invitecode");
}

/**
* Sets the message text to display. Default value is "Hi!".
*
* @param text the message text to set
*/
public void setText(String text) {
this.getElement().setProperty("text", text);
}

/***
* Returns whether the button's icon is leading or not.
*
* @return boolean true if icon is leading
*/
public boolean isLeadingIcon() {
return this.getElement().getProperty("leading", false);
}

/**
* Sets if button's icon should be in leading position or not. By default icon is trailing.
*
* @param leading true to enable leading
*/
public void setLeadingIcon(boolean leading) {
this.getElement().setProperty("leading", leading);
}

/**
* Returns whether redirect is enabled or not.
*
* @return boolean the redirect value
*/
public boolean isRedirect() {
return this.getElement().getProperty("redirect", false);
}

/**
* Sets redirect option. This value should be true when button is use in not mobile devices.
*
* @param redirect true to enable redirect
*/
public void setRedirect(boolean redirect) {
this.getElement().setProperty("redirect", redirect);
}

/**
* Returns whether responsive is enabled or not.
*
* @return boolean the responsive value
*/
public boolean isResponsive() {
return this.getElement().getProperty("responsive", false);
}

/**
* Sets responsive option.
*
* @param redirect true to enable redirect
*/
public void setResponsive(boolean responsive) {
this.getElement().setProperty("responsive", responsive);
}

/**
* Returns whether dialog should be shown on button click.
*
* @return boolean the show dialog value
*/
public boolean isShowDialog() {
return this.getElement().getProperty("dialog", false);
}

/**
* Sets dialog option. If true, a dialog will show on button click indicating whatsapp is
* opening.
*
* @param redirect true to enable redirect
*/
public void setShowDialog(boolean dialog) {
this.getElement().setProperty("dialog", dialog);
}
Expand Down

0 comments on commit d43edd8

Please sign in to comment.