Overrides the checkState function.
@@ -13,44 +13,41 @@ public class TextAreaBuilder extends ComponentBuilder<TextArea> {
/** Whether or not the TextArea can be edited. */
private boolean editable;
- /**
- * The pattern used to determine which typed characters can be entered into
- * the field.
- */
- @NonNull private Pattern allowedCharacterPattern;
+ /** The pattern used to determine which typed characters can be entered into the field. */
+ private Pattern allowedCharacterPattern;
/** Whether the special listener code for the Enter key is enabled. */
- @Getter @Setter private boolean isEnterKeyEnabled = true;
+ private boolean isEnterKeyEnabled = true;
/** Whether the special listener code for the Backspace key is enabled. */
- @Getter @Setter private boolean isBackspaceKeyEnabled = true;
+ private boolean isBackspaceKeyEnabled = true;
/** Whether the special listener code for the Delete key is enabled. */
- @Getter @Setter private boolean isDeleteKeyEnabled = true;
+ private boolean isDeleteKeyEnabled = true;
/** Whether the special listener code for the Home key is enabled. */
- @Getter @Setter private boolean isHomeKeyEnabled = true;
+ private boolean isHomeKeyEnabled = true;
/** Whether the special listener code for the End key is enabled. */
- @Getter @Setter private boolean isEndKeyEnabled = true;
+ private boolean isEndKeyEnabled = true;
/** Whether the special listener code for the Page Up key is enabled. */
- @Getter @Setter private boolean isPageUpKeyEnabled = true;
+ private boolean isPageUpKeyEnabled = true;
/** Whether the special listener code for the Page Down key is enabled. */
- @Getter @Setter private boolean isPageDownKeyEnabled = true;
+ private boolean isPageDownKeyEnabled = true;
/** Whether the special listener code for the Up Arrow key is enabled. */
- @Getter @Setter private boolean isUpArrowKeyEnabled = true;
+ private boolean isUpArrowKeyEnabled = true;
/** Whether the special listener code for the Down Arrow key is enabled. */
- @Getter @Setter private boolean isDownArrowKeyEnabled = true;
+ private boolean isDownArrowKeyEnabled = true;
/** Whether the special listener code for the Left Arrow key is enabled. */
- @Getter @Setter private boolean isLeftArrowKeyEnabled = true;
+ private boolean isLeftArrowKeyEnabled = true;
/** Whether the special listener code for the Right Arrow key is enabled. */
- @Getter @Setter private boolean isRightArrowKeyEnabled = true;
+ private boolean isRightArrowKeyEnabled = true;
@Override
public TextArea build() {
@@ -58,6 +55,15 @@ public class TextAreaBuilder extends ComponentBuilder<TextArea> {
return new TextArea(this);
}
+ @Override
+ protected void checkState() {
+ super.checkState();
+
+ if (allowedCharacterPattern == null) {
+ allowedCharacterPattern = Pattern.compile("^[a-zA-z0-9$-/:-?{-~!\"^_`\\[\\]@# ]$");
+ }
+ }
+
@Override
public void reset() {
super.reset();
