|
| 1 | +package io.sentry; |
| 2 | + |
| 3 | +import org.jetbrains.annotations.NotNull; |
| 4 | + |
| 5 | +public class SentryFeedbackOptions { |
| 6 | + |
| 7 | + // User and Form |
| 8 | + /** Requires the name field on the feedback form to be filled in. */ |
| 9 | + private boolean isNameRequired = false; |
| 10 | + /** Displays the name field on the feedback form. Ignored if isNameRequired is true. */ |
| 11 | + private boolean showName = true; |
| 12 | + /** Requires the email field on the feedback form to be filled in. */ |
| 13 | + private boolean isEmailRequired = false; |
| 14 | + /** Displays the email field on the feedback form. Ignored if isEmailRequired is true. */ |
| 15 | + private boolean showEmail = true; |
| 16 | + /** Sets the email and name fields to the corresponding Sentry SDK user fields that were called with SentrySDK.setUser. */ |
| 17 | + private boolean useSentryUser = true; |
| 18 | + /** Displays the Sentry logo inside of the form */ |
| 19 | + private boolean showBranding = true; |
| 20 | + |
| 21 | + // Text Customization |
| 22 | + /** The title of the feedback form. */ |
| 23 | + private @NotNull String formTitle = "Report a Bug"; |
| 24 | + /** The label of the submit button. */ |
| 25 | + private @NotNull String submitButtonLabel = "Send Bug Report"; |
| 26 | + /** The label of the cancel button. */ |
| 27 | + private @NotNull String cancelButtonLabel = "Cancel"; |
| 28 | + /** The label of the confirm button. */ |
| 29 | + private @NotNull String confirmButtonLabel = "Confirm"; |
| 30 | + /** The label next to the name input field. */ |
| 31 | + private @NotNull String nameLabel = "Name"; |
| 32 | + /** The placeholder in the name input field. */ |
| 33 | + private @NotNull String namePlaceholder = "Your Name"; |
| 34 | + /** The label next to the email input field. */ |
| 35 | + private @NotNull String emailLabel = "Email"; |
| 36 | + /** The placeholder in the email input field. */ |
| 37 | + private @NotNull String emailPlaceholder = "your.email@example.org"; |
| 38 | + /** The text to attach to the title label for a required field. */ |
| 39 | + private @NotNull String isRequiredLabel = "(Required)"; |
| 40 | + /** The label of the feedback description input field. */ |
| 41 | + private @NotNull String messageLabel = "Description"; |
| 42 | + /** The placeholder in the feedback description input field. */ |
| 43 | + private @NotNull String messagePlaceholder = "What's the bug? What did you expect?"; |
| 44 | + /** The message displayed after a successful feedback submission. */ |
| 45 | + private @NotNull String successMessageText = "Thank you for your report!"; |
| 46 | + |
| 47 | + public boolean isNameRequired() { |
| 48 | + return isNameRequired; |
| 49 | + } |
| 50 | + public void setNameRequired(boolean isNameRequired) { |
| 51 | + this.isNameRequired = isNameRequired; |
| 52 | + } |
| 53 | + public boolean isShowName() { |
| 54 | + return showName; |
| 55 | + } |
| 56 | + public void setShowName(boolean showName) { |
| 57 | + this.showName = showName; |
| 58 | + } |
| 59 | + public boolean isEmailRequired() { |
| 60 | + return isEmailRequired; |
| 61 | + } |
| 62 | + public void setEmailRequired(boolean isEmailRequired) { |
| 63 | + this.isEmailRequired = isEmailRequired; |
| 64 | + } |
| 65 | + public boolean isShowEmail() { |
| 66 | + return showEmail; |
| 67 | + } |
| 68 | + public void setShowEmail(boolean showEmail) { |
| 69 | + this.showEmail = showEmail; |
| 70 | + } |
| 71 | + |
| 72 | + public boolean isUseSentryUser() { |
| 73 | + return useSentryUser; |
| 74 | + } |
| 75 | + public void setUseSentryUser(boolean useSentryUser) { |
| 76 | + this.useSentryUser = useSentryUser; |
| 77 | + } |
| 78 | + public boolean isShowBranding() { |
| 79 | + return showBranding; |
| 80 | + } |
| 81 | + public void setShowBranding(boolean showBranding) { |
| 82 | + this.showBranding = showBranding; |
| 83 | + } |
| 84 | + |
| 85 | + CONTINUE |
| 86 | + public @NotNull String getFormTitle() { |
| 87 | + return formTitle; |
| 88 | + } |
| 89 | + public void setFormTitle(@NotNull String formTitle) { |
| 90 | + this.formTitle = formTitle; |
| 91 | + } |
| 92 | + public @NotNull String getSubmitButtonLabel() { |
| 93 | + return submitButtonLabel; |
| 94 | + } |
| 95 | + public void setSubmitButtonLabel(@NotNull String submitButtonLabel) { |
| 96 | + this.submitButtonLabel = submitButtonLabel; |
| 97 | + } |
| 98 | + public @NotNull String getCancelButtonLabel() { |
| 99 | + return cancelButtonLabel; |
| 100 | + } |
| 101 | + public void setCancelButtonLabel(@NotNull String cancelButtonLabel) { |
| 102 | + this.cancelButtonLabel = cancelButtonLabel; |
| 103 | + } |
| 104 | + public @NotNull String getConfirmButtonLabel() { |
| 105 | + return confirmButtonLabel; |
| 106 | + } |
| 107 | + public void setConfirmButtonLabel(@NotNull String confirmButtonLabel) { |
| 108 | + this.confirmButtonLabel = confirmButtonLabel; |
| 109 | + } |
| 110 | + public @NotNull String getNameLabel() { |
| 111 | + return nameLabel; |
| 112 | + } |
| 113 | + public void setNameLabel(@NotNull String nameLabel) { |
| 114 | + this.nameLabel = nameLabel; |
| 115 | + } |
| 116 | + public @NotNull String getNamePlaceholder() { |
| 117 | + return namePlaceholder; |
| 118 | + } |
| 119 | + public void setNamePlaceholder(@NotNull String namePlaceholder) { |
| 120 | + this.namePlaceholder = namePlaceholder; |
| 121 | + } |
| 122 | + public @NotNull String getEmailLabel() { |
| 123 | + return emailLabel; |
| 124 | + } |
| 125 | + public void setEmailLabel(@NotNull String emailLabel) { |
| 126 | + this.emailLabel = emailLabel; |
| 127 | + } |
| 128 | + public @NotNull String getEmailPlaceholder() { |
| 129 | + return emailPlaceholder; |
| 130 | + } |
| 131 | + public void setEmailPlaceholder(@NotNull String emailPlaceholder) { |
| 132 | + this.emailPlaceholder = emailPlaceholder; |
| 133 | + } |
| 134 | + public @NotNull String getIsRequiredLabel() { |
| 135 | + return isRequiredLabel; |
| 136 | + } |
| 137 | + public void setIsRequiredLabel(@NotNull String isRequiredLabel) { |
| 138 | + this.isRequiredLabel = isRequiredLabel; |
| 139 | + } |
| 140 | + |
| 141 | + public @NotNull String getMessageLabel() { |
| 142 | + return messageLabel; |
| 143 | + } |
| 144 | + public void setMessageLabel(@NotNull String messageLabel) { |
| 145 | + this.messageLabel = messageLabel; |
| 146 | + } |
| 147 | + public @NotNull String getMessagePlaceholder() { |
| 148 | + return messagePlaceholder; |
| 149 | + } |
| 150 | + public void setMessagePlaceholder(@NotNull String messagePlaceholder) { |
| 151 | + this.messagePlaceholder = messagePlaceholder; |
| 152 | + } |
| 153 | + public @NotNull String getSuccessMessageText() { |
| 154 | + return successMessageText; |
| 155 | + } |
| 156 | + public void setSuccessMessageText(@NotNull String successMessageText) { |
| 157 | + this.successMessageText = successMessageText; |
| 158 | + } |
| 159 | + @Override |
| 160 | + public String toString() { |
| 161 | + return "SentryFeedbackOptions{" |
| 162 | + + "isNameRequired=" |
| 163 | + + isNameRequired |
| 164 | + + ", showName=" |
| 165 | + + showName |
| 166 | + + ", isEmailRequired=" |
| 167 | + + isEmailRequired |
| 168 | + + ", showEmail=" |
| 169 | + + showEmail |
| 170 | + + ", useSentryUser=" |
| 171 | + + useSentryUser |
| 172 | + + ", showBranding=" |
| 173 | + + showBranding |
| 174 | + + ", formTitle='" |
| 175 | + + formTitle |
| 176 | + + '\'' |
| 177 | + + ", submitButtonLabel='" |
| 178 | + + submitButtonLabel |
| 179 | + + '\'' |
| 180 | + + ", cancelButtonLabel='" |
| 181 | + + cancelButtonLabel |
| 182 | + + '\'' |
| 183 | + + ", confirmButtonLabel='" |
| 184 | + + confirmButtonLabel |
| 185 | + + '\'' |
| 186 | + + ", nameLabel='" |
| 187 | + + nameLabel |
| 188 | + + '\'' |
| 189 | + + ", namePlaceholder='" |
| 190 | + + namePlaceholder |
| 191 | + + '\'' |
| 192 | + + ", emailLabel='" |
| 193 | + + emailLabel |
| 194 | + + '\'' |
| 195 | + + ", emailPlaceholder='" |
| 196 | + + emailPlaceholder |
| 197 | + + '\'' |
| 198 | + + ", isRequiredLabel='" |
| 199 | + + isRequiredLabel |
| 200 | + + '\'' |
| 201 | + + ", messageLabel='" |
| 202 | + + messageLabel |
| 203 | + + '\'' |
| 204 | + + ", messagePlaceholder='" |
| 205 | + + messagePlaceholder |
| 206 | + + '\'' |
| 207 | + + '}'; |
| 208 | + } |
| 209 | +} |
0 commit comments