public interface FormFieldComponent extends FormComponent
FormComponent for editable text fields.Adds features like max columns, autoselect, autotext, conversion, etc...
| Modifier and Type | Field and Description |
|---|---|
static char |
ADJUST_LEFT
remove leading fillers
|
static char |
ADJUST_NONE
no adjustment at all
|
static char |
ADJUST_RIGHT
remove trailing fillers
|
static char |
ADJUST_TRIM
trim to both sides (default)
|
static char |
CONVERT_LC
to lowercase
|
static char |
CONVERT_NONE
no conversion (default)
|
static char |
CONVERT_UC
to uppercase
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearText()
Clears the contents of this component.
|
String |
doFormat(Object object)
Does the formatting of the given object.
Renders the object and returns the string. |
void |
downRight()
Move the caret to the right side of field and if already there move to next field.
|
char |
getAdjust()
Gets the current adjustment.
|
int |
getCaretPosition()
Gets the caret position.
|
int |
getColumns()
Gets the columns.
|
char |
getConvert()
Gets the current convesion
|
Function<String,String> |
getConverter()
Gets the current converter.
|
int |
getDefaultColumns()
Gets the default columns.
|
String |
getErrorMessage()
Gets the parsing error message for the first error.
|
int |
getErrorOffset()
Gets the offset in this components text for the first parsing error.
|
char |
getFiller()
Gets the current fill char.
|
String |
getFormat()
Gets the format string.
|
int |
getHorizontalAlignment()
Gets the horizontal alignment.
|
String |
getInvalidChars()
Gets invalid characters.
|
int |
getMaxColumns()
Gets the maximum number of columns.
|
String |
getText()
Gets the text from the view of this component.
|
String |
getToolTipText()
Gets the tooltip text for this component.
|
String |
getValidChars()
Gets allowed characters.
|
int |
getVerticalAlignment()
Gets the vertical alignment.
|
boolean |
isAutoNext()
Returns whether the auto-next feature is enabled.
|
boolean |
isAutoSelect()
Returns whether the auto-select feature is enabled.
|
boolean |
isCaretLeft()
Returns whether carat is at leftmost position.
|
boolean |
isCaretRight()
Returns whether caret is at rightmost position.
|
boolean |
isEmpty()
Determines whether this component is empty.
|
boolean |
isEraseFirst()
Returns whether to erase the field after first setText().
|
boolean |
isInhibitAutoSelect()
Returns whether auto-select is inhibited (once).
|
boolean |
isOverwrite()
Gets the current override mode.
|
boolean |
isStartEditLeftmost()
Returns whether to start edit leftmost in this component (once).
|
void |
postActionEvent()
Invokes the action performed handler.
|
void |
setAdjust(char adjust)
Sets character adjustment.
By default the text input data is trimmed, i.e. |
void |
setAutoNext(boolean autoNext)
Sets the auto-next feature.
If autonext is enabled the next component will automatically receive the focus if the maximum number of characters is reached. |
void |
setAutoSelect(boolean autoSelect)
Sets the auto-select feature.
A component with autoselect enabled will automatically select all characters if the component gets the keyboard focus. |
void |
setCaretLeft()
Sets the caret to leftmost position.
|
void |
setCaretPosition(int pos)
Sets the caret position.
|
void |
setCaretRight()
Sets the caret to rightmost position.
|
void |
setColumns(int columns)
Sets the number of columns in this component.
The visible width is adjusted according to the current font. |
void |
setConvert(char convert)
Sets character upper/lowercase conversion.
Notice that changing the character conversion will immediately convert. |
void |
setConverter(Function<String,String> converter)
Sets the string converter.
Besides the lower/uppercase conversion an optional converter may be set to translate characters. |
void |
setDefaultColumns(int defaultColumns)
Sets the default columns.
The method is mainly provided for GUI-designers and will change the displayed size if, and only if, setColumns() and setMaxColumns() has not been invoked yet. |
void |
setEraseFirst(boolean eraseFirst)
Sets whether to erase the field after first setText().
|
void |
setErrorMessage(String errorMessage)
Sets the error message.
|
void |
setErrorOffset(int errorOffset)
Sets the error offset.
|
void |
setFiller(char filler)
Sets the fill char.
The fill char determines the adjustment of the text data. |
void |
setFormat(String pattern)
Sets the format string.
The format string is used to format the view of the data. |
void |
setHorizontalAlignment(int alignment)
Sets the horizontal alignment.
|
void |
setInhibitAutoSelect(boolean inhibitAutoSelect)
Sets auto-select to be inhibited inhibited (once).
|
void |
setInvalidChars(String invalidChars)
Sets invalid characters.
|
void |
setMaxColumns(int maxColumns)
Sets the maximum number of columns.
The number of columns will be enforced by the model. |
void |
setOverwrite(boolean override)
Sets the insert/override mode.
|
void |
setStartEditLeftmost(boolean startEditLeftmost)
Sets whether to start edit leftmost in this component (once).
|
void |
setText(String str)
Sets the given text in the view of this component.
|
void |
setToolTipText(String text)
Sets the tooltip text for this component.
|
void |
setValidChars(String validChars)
Sets allowed characters.
|
void |
setVerticalAlignment(int alignment)
Sets the vertical alignment.
Can only be used in Tentackle-LookAndFeels! |
void |
upLeft()
Move caret to the left side of field and if already there move to previous field.
|
addValueListener, clearValueShownModified, fireValueChanged, fireValueEntered, getBaseline, getBinding, getBindingPath, getComponentPath, getFocusTraversalGroup, getFormValue, getHelpURL, getParentWindow, getPropertyGroup, getValueShown, hasFocus, invalidateParentInfo, isAutoUpdate, isBindable, isCellEditorUsage, isFireRunning, isFormTraversable, isMandatory, isSmartValueEntered, isTriggerValueChangedEnabled, isValueChanged, isValueShownModified, prepareFocusLost, removeValueListener, requestFocusLater, saveValue, setAutoUpdate, setBindable, setBinding, setBindingPath, setCellEditorUsage, setComponentPath, setFireRunning, setFocusTraversalGroup, setFormTraversable, setFormValue, setFormWrapWindow, setHelpURL, setMandatory, setPropertyGroup, setSmartValueEntered, setTriggerValueChangedEnabled, showErrorPopup, showHelp, transferFocus, transferFocusBackward, triggerValueChanged, wasFocusGainedFromTransfer, wasFocusGainedFromTransferBackward, wasTransferFocus, wasTransferFocusBackward, wasTransferFocusByEnterupdateAllChangeableisChangeable, isHonourChangeable, setChangeable, setHonourChangeablestatic final char ADJUST_NONE
static final char ADJUST_LEFT
static final char ADJUST_RIGHT
static final char ADJUST_TRIM
static final char CONVERT_NONE
static final char CONVERT_UC
static final char CONVERT_LC
void setFormat(String pattern)
pattern - the format stringString getFormat()
void setAutoSelect(boolean autoSelect)
autoSelect - true if autoselect enabled, false if disabled (default)boolean isAutoSelect()
void setAutoNext(boolean autoNext)
autoNext - true if autonext enabled, false if disabled (default)boolean isAutoNext()
void setConvert(char convert)
convert - one of FormField.CONVERT_...char getConvert()
void setConverter(Function<String,String> converter)
converter - the converter, null if none (default)Function<String,String> getConverter()
void setAdjust(char adjust)
adjust - one of FormField.ADJUST_...setFiller(char)char getAdjust()
void setMaxColumns(int maxColumns)
If JTextField.getColumns() == 0 the component will resize as
if setColumns has been invoked with the given maxColumns. However,
getColumns() remains 0.
maxColumns - the maximum number of columns, 0 if unlimited (default)int getMaxColumns()
void setDefaultColumns(int defaultColumns)
With defaultColumns it is possible to set the width of a field to a reasonable size and let the application use setMaxColumn() to set the real value from the model (which is not available at design time).
defaultColumns - the default columnsint getDefaultColumns()
void setFiller(char filler)
filler - the fill charactersetAdjust(char)char getFiller()
void setOverwrite(boolean override)
override - true if override, false if insert (default)boolean isOverwrite()
void setValidChars(String validChars)
validChars - the valid characters, null = all (default)String getValidChars()
void setInvalidChars(String invalidChars)
invalidChars - the invalid characters, null = none (default)String getInvalidChars()
boolean isCaretLeft()
boolean isCaretRight()
void setCaretLeft()
void setCaretRight()
void upLeft()
void downRight()
void setEraseFirst(boolean eraseFirst)
eraseFirst - true to clear after first setTextboolean isEraseFirst()
void setInhibitAutoSelect(boolean inhibitAutoSelect)
inhibitAutoSelect - true if inhibitedboolean isInhibitAutoSelect()
void clearText()
String doFormat(Object object)
object - the objectboolean isEmpty()
void setStartEditLeftmost(boolean startEditLeftmost)
startEditLeftmost - true if start edit leftmostboolean isStartEditLeftmost()
int getErrorOffset()
void setErrorOffset(int errorOffset)
errorOffset - the error offset in the text component, -1 to clearString getErrorMessage()
void setErrorMessage(String errorMessage)
errorMessage - the message, null to clearvoid postActionEvent()
void setText(String str)
str - the textString getText()
void setColumns(int columns)
columns - the number of columns ≥ 0int getColumns()
void setToolTipText(String text)
text - the tooltip text, null = noneString getToolTipText()
void setHorizontalAlignment(int alignment)
alignment - the alignmentComponentint getHorizontalAlignment()
Componentvoid setVerticalAlignment(int alignment)
alignment - the vertical alignmentint getVerticalAlignment()
void setCaretPosition(int pos)
pos - the caret position, 0 = start of fieldint getCaretPosition()
Tentackle - distributed, domain- and model-driven