public class MustTextField extends MustInputField
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
additionalTagFragments |
protected java.lang.String |
className |
protected boolean |
editable |
protected boolean |
enabled |
protected int |
fontSize |
protected int |
maxlength |
protected boolean |
required |
protected int |
size |
comment, focus, name, placeholder, toolTipText
Constructor and Description |
---|
MustTextField()
Constructs a new text field with a default length of 20 characters.
|
MustTextField(int length)
Constructs a new text field with the length as specified.
|
MustTextField(int size,
int maxlength)
Constructs a new text field with the specified size and max length.
|
MustTextField(java.lang.String name,
int length)
Constructs a new text field with the specified name and value.
|
MustTextField(java.lang.String name,
java.lang.String value,
int size,
int maxlength)
Constructs a new text field with the specified name, value, size and max length.
|
Modifier and Type | Method and Description |
---|---|
void |
fetchYourValueFromRequest(GeneralizedRequest request)
Causes the component to read user input by calling request.getParameter and
update the internal mirrored value.
|
java.lang.String |
getCreationTag()
Returns the tag sequence that's needed to show this object in the user
interface.
|
java.lang.String |
getText()
Return the text of the text field.
|
java.lang.String |
getTextOrNullIfEmpty()
Return the text of the field or null if the text field is empty or
contains spaces only.
|
boolean |
isFilled() |
boolean |
isModified()
Indicates whether the component's value differs from its initial value.
|
boolean |
isRequirementUnfulfilled()
Returns true if the component's value is mandatory but not filled.
|
boolean |
isValid()
Returns true the text field is valid.
|
void |
setAdditionalTagFragments(java.lang.String additionalTagFragments)
Sets the component's additional tag fragments.
|
void |
setClassName(java.lang.String className)
Sets the component's class name - may be used to assign formatting
via stylesheets.
|
void |
setColumns(int columns)
Sets the component's size via number of columns to be displayed.
|
static void |
setDefaultAdditionalTagFragments(java.lang.String newDefaultAdditionalTagFragments)
Sets the component's default additional tag fragments.
|
static void |
setDefaultClassName(java.lang.String newDefaultClassName)
Sets the component's default class name - may be used to assign formatting
via stylesheets.
|
void |
setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this component
should be editable.
|
void |
setEnabled(boolean enabled)
Sets the specified boolean to indicate whether or not this component
is enabled.
|
void |
setFontSize(int fontSize) |
void |
setMaxlength(int maxlength)
Sets the maximum string length to be entered.
|
void |
setRequired(boolean required)
Sets the fact that user input is requested (mandatory)
|
void |
setText(java.lang.String newText)
Sets the text.
|
java.lang.String |
toString()
Returns the tag sequence that's needed to show this object in the user
interface.
|
destroy, getName, setComment, setFocus, setPlaceHolder, setToolTipText
protected java.lang.String className
protected java.lang.String additionalTagFragments
protected int size
protected int maxlength
protected int fontSize
protected boolean required
protected boolean editable
protected boolean enabled
public MustTextField()
public MustTextField(int length)
length
- the length of the text fieldpublic MustTextField(int size, int maxlength)
size
- rendering relevant size of the text fieldmaxlength
- input control relevant max length of the text fieldpublic MustTextField(java.lang.String name, int length)
name
- the name of the field to be used for markup parameterslength
- rendering relevant length of the text fieldpublic MustTextField(java.lang.String name, java.lang.String value, int size, int maxlength)
name
- the name of the field to be used for markup parametersvalue
- the initial value of the text fieldsize
- rendering relevant size of the text fieldmaxlength
- input control relevant max length of the text fieldpublic void setMaxlength(int maxlength)
maxlength
- input control relevant max length of the text fieldpublic static void setDefaultClassName(java.lang.String newDefaultClassName)
newDefaultClassName
- the component's default class namepublic void setClassName(java.lang.String className)
newDefaultClassName
- the component's class namepublic static void setDefaultAdditionalTagFragments(java.lang.String newDefaultAdditionalTagFragments)
newDefaultClassName
- the component's default additional tag fragments.public void setAdditionalTagFragments(java.lang.String additionalTagFragments)
newDefaultClassName
- the component's additional tag fragments.public void setColumns(int columns)
columns
- the number of columns to be displayedpublic void setFontSize(int fontSize)
public void setEditable(boolean editable)
editable
- indicates whether or not this component is editablepublic void setEnabled(boolean enabled)
enabled
- indicates whether or not this component is enabledpublic java.lang.String toString()
toString
in class MustInputField
public java.lang.String getCreationTag()
public void fetchYourValueFromRequest(GeneralizedRequest request)
fetchYourValueFromRequest
in interface ValueFetcher
fetchYourValueFromRequest
in class MustInputField
request
- the current requestpublic java.lang.String getText()
public java.lang.String getTextOrNullIfEmpty()
public void setText(java.lang.String newText)
newText
- the new textpublic void setRequired(boolean required)
required
- whether this inuput is mandatory or not.public boolean isFilled()
public boolean isValid()
public boolean isRequirementUnfulfilled()
public boolean isModified()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de