public abstract class AbstractFormField extends JTextField implements FormFieldComponent
All Tentackle beans providing a single-line text field bean subclass
the AbstractFormField class which implements FormFieldComponent.
FormFields provide a lot of features essential for typical business
applications, such as data binding.
JTextField.AccessibleJTextFieldJTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBindingJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected String |
errorMessage
the error message corresponding to errorOffset
|
protected int |
errorOffset
caret position for (first) error, -1 if no error
|
protected String |
savedValue
last savepoint
|
notifyActionDEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEYlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTADJUST_LEFT, ADJUST_NONE, ADJUST_RIGHT, ADJUST_TRIM, CONVERT_LC, CONVERT_NONE, CONVERT_UCBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WESTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AbstractFormField()
Creates an empty AbstractFormField with the default document model,
and minimum column width.
|
AbstractFormField(Document doc,
String str,
int columns)
Creates a AbstractFormField.
Notice: setting doc != null requires a doc derived from FormFieldDocument. |
AbstractFormField(int columns)
Creates a AbstractFormField with the default document model and
given column width.
|
AbstractFormField(String str)
Creates a AbstractFormField with the default document model,
minimum width and given initial text.
|
AbstractFormField(String str,
int columns)
Creates a AbstractFormField with the default document model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addValueListener(ValueListener listener)
Adds a value listener that implements the binding between this component
and the data.
|
void |
clearText()
Clears the contents of this component.
|
void |
clearValueShownModified()
Clears the value shown status.
May be used by components that update the value shown programmatically. |
protected Document |
createDefaultModel() |
void |
downRight()
Move the caret to the right side of field and if already there move to next field.
|
void |
fireValueChanged()
Fires all value listeners registered on this component
invoking their
valueChanged-handler.This method is invoked whenever the data has been changed and that change should be reflected in the view. |
void |
fireValueEntered()
Fires all listeners registered on this component
invoking their
valueEntered-handler.This method is invoked whenever the user edited the view and that change should be reflected in the data. |
char |
getAdjust()
Gets the current adjustment.
|
FormComponentBinding |
getBinding()
Gets the binding.
|
String |
getBindingPath()
Gets the binding path.
|
String |
getComponentPath()
Gets the component path.
|
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.
|
FocusTraversalGroup |
getFocusTraversalGroup()
Gets the focus traversal group for this component.
|
String |
getHelpURL()
Gets the online-help URL.
|
String |
getInvalidChars()
Gets invalid characters.
|
int |
getMaxColumns()
Gets the maximum number of columns.
|
Window |
getParentWindow()
Gets the parent window of this component.
|
Dimension |
getPreferredSize() |
PropertyGroup |
getPropertyGroup()
Gets the property group for this component.
|
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.
|
String |
getValueShown()
Gets the value shown to the user.
This is the visual representation, not necessarily the model's value. |
int |
getVerticalAlignment()
Gets the vertical alignment.
|
protected void |
hideErrorPopup()
Removes any error popup.
|
void |
invalidateParentInfo()
Invalidates all container-relevant (cached) information
for the hierarchy of this component's parents.
For optimization purposes. |
boolean |
isAutoNext()
Returns whether the auto-next feature is enabled.
|
boolean |
isAutoSelect()
Returns whether the auto-select feature is enabled.
|
boolean |
isAutoUpdate()
Returns whether the auto-update feature is enabled.
|
boolean |
isBindable()
Determines whether this component is bindable.
|
boolean |
isCaretLeft()
Returns whether carat is at leftmost position.
|
boolean |
isCaretRight()
Returns whether caret is at rightmost position.
|
boolean |
isCellEditorUsage()
Returns whether this component is used as a cell editor.
|
boolean |
isChangeable()
Returns if this component is changeable.
|
boolean |
isEmpty()
Determines whether this component is empty.
|
boolean |
isEraseFirst()
Returns whether to erase the field after first setText().
|
boolean |
isFireRunning()
Checks whether a fire-method is running.
|
boolean |
isFormTraversable()
Returns whether this component is form traversable or not.
|
boolean |
isHonourChangeable()
Returns whether this component should honour the changeable-attribute or not.
|
boolean |
isInhibitAutoSelect()
Returns whether auto-select is inhibited (once).
|
boolean |
isMandatory()
Gets the mandatory option.
|
boolean |
isOverwrite()
Gets the current override mode.
|
boolean |
isSmartValueEntered()
Returns whether the model should only be updated
if the component's value really changed.
The default is true. |
boolean |
isStartEditLeftmost()
Returns whether to start edit leftmost in this component (once).
|
boolean |
isTriggerValueChangedEnabled()
Determines whether triggering value changes is enabled.
|
boolean |
isValueChanged()
Checks whether the contents have been changed since the last savepoint.
|
boolean |
isValueShownModified()
Checks whether the currently shown value differs
from the initially shown.
Used to implement smartValueEntered. |
void |
prepareFocusLost()
Prepares for FOCUS_LOST.
Gives this component the opportunity to invoke fireValueEntered() earlier than FOCUS_LOST is really received. |
protected void |
processFocusEvent(FocusEvent e) |
protected boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed) |
void |
removeValueListener(ValueListener listener)
Remove a value listener.
|
void |
requestFocusLater()
Requests the keyboard focus for this component by appending
an event to the end of the event queue.
Applications should not use requestFocus() or requestFocusInWindow() unless the order in which the events are processed is unimportant. |
protected void |
restoreSavedValue()
Restores the previously saved value.
Method is provided to be overridden by AbstractNumberFormField. |
void |
saveValue()
Sets a savepoint for the data of this component.
Allows to decide whether the user has changed the data associated with this component or not. |
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 |
setAutoUpdate(boolean autoupdate)
Sets the auto-update feature.
By default, all components update the data model if the view changes (due to certain events, for example focus lost). |
void |
setBindable(boolean bindable)
Sets whether this component is bindable.
|
void |
setBinding(FormComponentBinding binding)
Sets the binding.
|
void |
setBindingPath(String bindingPath)
Sets the path to bind this component to.
|
void |
setCaretLeft()
Sets the caret to leftmost position.
|
void |
setCaretRight()
Sets the caret to rightmost position.
|
void |
setCellEditorUsage(boolean flag)
Sets a hint that this component is used as a cell editor.
Some components behave differently in tables than in forms, for example. |
void |
setChangeable(boolean changeable)
Set the component to be changeable.
This is a unified abstraction and will be translated to setEditable or setEnabled, whatever is appropriate to this component. |
void |
setColumns(int columns)
Sets the number of columns in this component.
The visible width is adjusted according to the current font. |
void |
setComponentPath(String componentPath)
Sets the component path.
|
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 |
setEditable(boolean editable) |
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 |
setFireRunning(boolean running)
Sets a component's flag that a fire-method is currently running.
Used by the framework to minimize valueChanged/valueEntered processing. |
void |
setFocusTraversalGroup(FocusTraversalGroup group)
Sets the focus traversal group for this component.
|
void |
setFormTraversable(boolean formTraversable)
Sets whether this component is form traversable or not, i.e.
|
void |
setFormWrapWindow(FormWindow parent)
Sets the window that will fire a
FormWrapEvent when this
components loses the keyboard focus. |
void |
setHelpURL(String helpURL)
Sets the online-help URL.
If a help url is set for this component, a browser will be launched to show that url. |
void |
setHonourChangeable(boolean flag)
Sets whether this component should honour the changeable-attribute or not.
The default is true. |
void |
setInhibitAutoSelect(boolean inhibitAutoSelect)
Sets auto-select to be inhibited inhibited (once).
|
void |
setInvalidChars(String invalidChars)
Sets invalid characters.
|
void |
setMandatory(boolean mandatory)
Sets the mandatory option.
Mandatory fields are differently visualized. |
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 |
setPropertyGroup(PropertyGroup group)
Sets the property group for this component.
|
void |
setSmartValueEntered(boolean smartValueEntered)
Sets whether the model should only be updated
if the component's value really changed.
The default is true. |
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 |
setTriggerValueChangedEnabled(boolean enabled)
Enables triggering value changes.
Disabling this feature may be necessary for model-agnostic components. |
void |
setValidChars(String validChars)
Sets allowed characters.
|
void |
setVerticalAlignment(int alignment)
Sets the vertical alignment.
Can only be used in Tentackle-LookAndFeels! |
protected void |
showErrorPopup()
Shows the error popup if parsing failed
|
void |
showErrorPopup(String message)
Shows the error popup for a given message.
The popup component used is an ErrorToolTip. |
void |
showHelp()
Displays online help for this component.
Usually triggered by KeyEvent.VK_F1 or VK_HELP or a button. |
void |
transferFocus()
Transfers keyboard focus forward to the logically next component.
|
void |
transferFocusBackward()
Transfers keyboard focus forward to the logically previous component.
|
void |
triggerValueChanged()
Promotes the fact that value changed to all
FormContainers this
component is a child of. |
void |
updateAllChangeable(boolean allChangeable)
Updates the container's changeable flag.
|
void |
upLeft()
Move caret to the left side of field and if already there move to previous field.
|
boolean |
wasFocusGainedFromTransfer()
Returns whether the keyboard focus was gained due to
FormComponent.transferFocus()
in the opposite component. |
boolean |
wasFocusGainedFromTransferBackward()
Returns whether the keyboard focus was gained due to
FormComponent.transferFocusBackward()
in the opposite component. |
boolean |
wasTransferFocus()
Returns whether this component lost the keyboard focus due to
FormComponent.transferFocus(). |
boolean |
wasTransferFocusBackward()
Returns whether this component lost the keyboard focus due to
FormComponent.transferFocusBackward(). |
boolean |
wasTransferFocusByEnter()
Returns whether this component lost the keyboard focus due to
KeyEvent.VK_ENTER. |
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setDocument, setFont, setHorizontalAlignment, setScrollOffsetaddCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, writeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdoFormat, getCaretPosition, getColumns, getFormat, getHorizontalAlignment, postActionEvent, setCaretPosition, setFormat, setHorizontalAlignment, setToolTipTextgetBaseline, getFormValue, hasFocus, setFormValueprotected int errorOffset
protected String errorMessage
protected String savedValue
public AbstractFormField(Document doc, String str, int columns)
doc - the document model, null = defaultstr - the initial text, null = emptycolumns - the number of columns, 0 = minimum widthpublic AbstractFormField(String str, int columns)
str - the initial text, null = emptycolumns - the number of columns, 0 = minimum widthpublic AbstractFormField(String str)
str - the initial text, null = emptypublic AbstractFormField(int columns)
columns - the number of columns, 0 = minimum widthpublic AbstractFormField()
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
Overridden: Changes the nerving behaviour that pressing backspace at the end of a selection clears the whole selection. Especially in autoselected numeric fields its often necessary to overtype the last digits. With this hack backspace simply clears the selection.
processKeyBinding in class JComponentprotected void restoreSavedValue()
AbstractNumberFormField.public void setColumns(int columns)
Overridden to inhibit excessive geometry-management (for example in Gridbaglayout).
setColumns in interface FormFieldComponentsetColumns in class JTextFieldcolumns - the number of columns ≥ 0protected Document createDefaultModel()
Overridden to set the default FormFieldDocument.
createDefaultModel in class JTextFieldprotected void processFocusEvent(FocusEvent e)
Overridden to perform focus handling and data binding
processFocusEvent in class Componentpublic void setText(String str)
Overridden to turn off autoNext during inserts and to implement eraseFirst.
setText in interface FormFieldComponentsetText in class JTextComponentstr - the textpublic String getText()
Overridden because of text adjustment.
getText in interface FormFieldComponentgetText in class JTextComponentpublic void transferFocus()
Ovwerwritten to set transferFocusDone.
transferFocus in interface FormComponenttransferFocus in class ComponentFormFocusTraversalPolicypublic void transferFocusBackward()
Ovwerwritten to set transferFocusBackwardDone.
transferFocusBackward in interface FormComponenttransferFocusBackward in class ComponentFormFocusTraversalPolicypublic void showErrorPopup(String message)
FormComponentErrorToolTip.showErrorPopup in interface FormComponentmessage - the message to be displayed, null to removeprotected void hideErrorPopup()
protected void showErrorPopup()
public void addValueListener(ValueListener listener)
FormComponentaddValueListener in interface FormComponentlistener - the value listener to addpublic void removeValueListener(ValueListener listener)
FormComponentremoveValueListener in interface FormComponentlistener - the value listener to removepublic void requestFocusLater()
FormComponentrequestFocusLater in interface FormComponentpublic void fireValueChanged()
FormComponentvalueChanged-handler.fireValueChanged in interface FormComponentpublic void fireValueEntered()
FormComponentvalueEntered-handler.fireValueEntered in interface FormComponentpublic void saveValue()
FormComponentsaveValue in interface FormComponentFormComponent.isValueChanged()public boolean isValueChanged()
FormComponentisValueChanged in interface FormComponentFormComponent.saveValue()public void setTriggerValueChangedEnabled(boolean enabled)
FormComponentsetTriggerValueChangedEnabled in interface FormComponentenabled - true if invoke FormComponent.triggerValueChanged() on each change (default), false if not.public boolean isTriggerValueChangedEnabled()
FormComponentisTriggerValueChangedEnabled in interface FormComponentFormComponent.triggerValueChanged() on each change (default), false if not.public void triggerValueChanged()
FormComponentFormContainers this
component is a child of.triggerValueChanged in interface FormComponentpublic void setCellEditorUsage(boolean flag)
FormComponentsetCellEditorUsage in interface FormComponentflag - true if component is a cell editor, false if not.public boolean isCellEditorUsage()
FormComponentisCellEditorUsage in interface FormComponentpublic void prepareFocusLost()
FormComponentprepareFocusLost in interface FormComponentpublic void showHelp()
FormComponentshowHelp in interface FormComponentpublic void clearText()
FormFieldComponentclearText in interface FormFieldComponentpublic boolean isEmpty()
FormFieldComponentisEmpty in interface FormFieldComponentpublic boolean isCaretLeft()
FormFieldComponentisCaretLeft in interface FormFieldComponentpublic boolean isCaretRight()
FormFieldComponentisCaretRight in interface FormFieldComponentpublic void upLeft()
FormFieldComponentupLeft in interface FormFieldComponentpublic void downRight()
FormFieldComponentdownRight in interface FormFieldComponentpublic void setCaretLeft()
FormFieldComponentsetCaretLeft in interface FormFieldComponentpublic void setCaretRight()
FormFieldComponentsetCaretRight in interface FormFieldComponentpublic void setEraseFirst(boolean erasefirst)
FormFieldComponentsetEraseFirst in interface FormFieldComponenterasefirst - true to clear after first setTextpublic boolean isEraseFirst()
FormFieldComponentisEraseFirst in interface FormFieldComponentpublic void setChangeable(boolean changeable)
FormChangeablesetChangeable in interface FormChangeablechangeable - true the user can edit the data, false if show onlypublic boolean isChangeable()
FormChangeableisChangeable in interface FormChangeablepublic void setHonourChangeable(boolean flag)
FormChangeablesetHonourChangeable in interface FormChangeableflag - true if honour the changeable attribute, false if notpublic boolean isHonourChangeable()
FormChangeableisHonourChangeable in interface FormChangeablepublic void updateAllChangeable(boolean allChangeable)
FormChangeableComponent
Whenever FormChangeable.setChangeable(boolean) is invoked
all of the container's components get this method invoked.
updateAllChangeable in interface FormChangeableComponentallChangeable - true if changeablepublic void setEditable(boolean editable)
setEditable in class JTextComponentpublic int getDefaultColumns()
FormFieldComponentgetDefaultColumns in interface FormFieldComponentpublic void setDefaultColumns(int defaultColumns)
FormFieldComponentWith 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).
setDefaultColumns in interface FormFieldComponentdefaultColumns - the default columnspublic void setMaxColumns(int maxColumns)
FormFieldComponent
If JTextField.getColumns() == 0 the component will resize as
if setColumns has been invoked with the given maxColumns. However,
getColumns() remains 0.
setMaxColumns in interface FormFieldComponentmaxColumns - the maximum number of columns, 0 if unlimited (default)public int getMaxColumns()
FormFieldComponentgetMaxColumns in interface FormFieldComponentpublic Dimension getPreferredSize()
getPreferredSize in class JTextFieldpublic void setConvert(char convert)
FormFieldComponentsetConvert in interface FormFieldComponentconvert - one of FormField.CONVERT_...public char getConvert()
FormFieldComponentgetConvert in interface FormFieldComponentpublic void setAdjust(char adjust)
FormFieldComponentsetAdjust in interface FormFieldComponentadjust - one of FormField.ADJUST_...FormFieldComponent.setFiller(char)public char getAdjust()
FormFieldComponentgetAdjust in interface FormFieldComponentpublic void setAutoSelect(boolean autoselect)
FormFieldComponentsetAutoSelect in interface FormFieldComponentautoselect - true if autoselect enabled, false if disabled (default)public boolean isAutoSelect()
FormFieldComponentisAutoSelect in interface FormFieldComponentpublic void setAutoNext(boolean autonext)
FormFieldComponentsetAutoNext in interface FormFieldComponentautonext - true if autonext enabled, false if disabled (default)public boolean isAutoNext()
FormFieldComponentisAutoNext in interface FormFieldComponentpublic void setAutoUpdate(boolean autoupdate)
FormComponentsetAutoUpdate in interface FormComponentautoupdate - true if auto update the data (default), false if notpublic boolean isAutoUpdate()
FormComponentisAutoUpdate in interface FormComponentpublic void setValidChars(String validChars)
FormFieldComponentsetValidChars in interface FormFieldComponentvalidChars - the valid characters, null = all (default)public String getValidChars()
FormFieldComponentgetValidChars in interface FormFieldComponentpublic void setInvalidChars(String invalidChars)
FormFieldComponentsetInvalidChars in interface FormFieldComponentinvalidChars - the invalid characters, null = none (default)public String getInvalidChars()
FormFieldComponentgetInvalidChars in interface FormFieldComponentpublic void setFiller(char filler)
FormFieldComponentsetFiller in interface FormFieldComponentfiller - the fill characterFormFieldComponent.setAdjust(char)public char getFiller()
FormFieldComponentgetFiller in interface FormFieldComponentpublic void setOverwrite(boolean override)
FormFieldComponentsetOverwrite in interface FormFieldComponentoverride - true if override, false if insert (default)public boolean isOverwrite()
FormFieldComponentisOverwrite in interface FormFieldComponentpublic void setStartEditLeftmost(boolean startEditLeftmost)
FormFieldComponentsetStartEditLeftmost in interface FormFieldComponentstartEditLeftmost - true if start edit leftmostpublic boolean isStartEditLeftmost()
FormFieldComponentisStartEditLeftmost in interface FormFieldComponentpublic int getErrorOffset()
FormFieldComponentgetErrorOffset in interface FormFieldComponentpublic void setErrorOffset(int errorOffset)
FormFieldComponentsetErrorOffset in interface FormFieldComponenterrorOffset - the error offset in the text component, -1 to clearpublic String getErrorMessage()
FormFieldComponentgetErrorMessage in interface FormFieldComponentpublic void setErrorMessage(String errorMessage)
FormFieldComponentsetErrorMessage in interface FormFieldComponenterrorMessage - the message, null to clearpublic void setFireRunning(boolean running)
FormComponentsetFireRunning in interface FormComponentrunning - true if some fire-method is runningpublic boolean isFireRunning()
FormComponentisFireRunning in interface FormComponentpublic boolean isInhibitAutoSelect()
FormFieldComponentisInhibitAutoSelect in interface FormFieldComponentpublic void setInhibitAutoSelect(boolean inhibitAutoSelect)
When set inhibits autoSelect once after having performed eraseFirst. This is necessary for components in a JTable because after pressing a key eraseFirst will be executed, then the key inserted and THEN the field gets the focusGained which will selectAll if autoSelect enabled. The eraseFirst is triggered in FormFieldComponentCellEditor. This flag is really package internal!
setInhibitAutoSelect in interface FormFieldComponentinhibitAutoSelect - true if inhibitedpublic void setFormWrapWindow(FormWindow parent)
FormComponentFormWrapEvent when this
components loses the keyboard focus. When fired the reference
to the window is cleared.setFormWrapWindow in interface FormComponentparent - the window (usually the parent window of this component).public void setVerticalAlignment(int alignment)
FormFieldComponentsetVerticalAlignment in interface FormFieldComponentalignment - the vertical alignmentpublic int getVerticalAlignment()
FormFieldComponentgetVerticalAlignment in interface FormFieldComponentpublic String getHelpURL()
FormComponentgetHelpURL in interface FormComponentpublic void setHelpURL(String helpURL)
FormComponentsetHelpURL in interface FormComponenthelpURL - the help urlFormUtilities.openHelpURL(Component)public Function<String,String> getConverter()
FormFieldComponentgetConverter in interface FormFieldComponentpublic void setConverter(Function<String,String> converter)
FormFieldComponentsetConverter in interface FormFieldComponentconverter - the converter, null if none (default)public Window getParentWindow()
FormComponentgetParentWindow in interface FormComponentpublic void invalidateParentInfo()
FormComponentinvalidateParentInfo in interface FormComponentpublic String getToolTipText()
Overridden to show tooltip in tooltipdisplay OR via mouse but not both.
getToolTipText in interface FormFieldComponentgetToolTipText in class JComponentpublic boolean wasTransferFocus()
FormComponentFormComponent.transferFocus().wasTransferFocus in interface FormComponentpublic boolean wasTransferFocusBackward()
FormComponentFormComponent.transferFocusBackward().wasTransferFocusBackward in interface FormComponentpublic boolean wasFocusGainedFromTransfer()
FormComponentFormComponent.transferFocus()
in the opposite component.wasFocusGainedFromTransfer in interface FormComponentFormFocusTraversalPolicypublic boolean wasFocusGainedFromTransferBackward()
FormComponentFormComponent.transferFocusBackward()
in the opposite component.wasFocusGainedFromTransferBackward in interface FormComponentFormFocusTraversalPolicypublic boolean wasTransferFocusByEnter()
FormComponentKeyEvent.VK_ENTER.wasTransferFocusByEnter in interface FormComponentpublic void setFormTraversable(boolean formTraversable)
FormComponentsetFormTraversable in interface FormComponentformTraversable - true if traversable, false if notpublic boolean isFormTraversable()
FormComponentisFormTraversable in interface FormComponentpublic void setFocusTraversalGroup(FocusTraversalGroup group)
FormComponentsetFocusTraversalGroup in interface FormComponentgroup - the focus traversal grouppublic FocusTraversalGroup getFocusTraversalGroup()
FormComponentgetFocusTraversalGroup in interface FormComponentpublic void setPropertyGroup(PropertyGroup group)
FormComponentsetPropertyGroup in interface FormComponentgroup - the property grouppublic PropertyGroup getPropertyGroup()
FormComponentgetPropertyGroup in interface FormComponentpublic void setMandatory(boolean mandatory)
FormComponentsetMandatory in interface FormComponentmandatory - true if mandatorypublic boolean isMandatory()
FormComponentisMandatory in interface FormComponentpublic void setComponentPath(String componentPath)
FormComponentThe path is <declaring-class-name>.<field-name>. Example "de.krake.invoicer.InvoicePanel.customerNumberField".
Notice: the component path is set during binding.
setComponentPath in interface FormComponentcomponentPath - the component pathpublic String getComponentPath()
FormComponentgetComponentPath in interface FormComponentpublic void setBindingPath(String bindingPath)
FormComponentUsually the binding path will be determined from the components declared name. However, it can be set programatically as well.
setBindingPath in interface FormComponentbindingPath - the binding path, for ex. "invoiceNumber", null if autobindingBinderpublic String getBindingPath()
FormComponentgetBindingPath in interface FormComponentpublic void setBinding(FormComponentBinding binding)
FormComponentsetBinding in interface FormComponentbinding - the binding, null if none.public FormComponentBinding getBinding()
FormComponentgetBinding in interface FormComponentpublic void setBindable(boolean bindable)
FormComponentFormComponents are bindable by default.
setBindable in interface FormComponentbindable - true if bindable, else not eligible for the binding processpublic boolean isBindable()
FormComponentisBindable in interface FormComponentpublic String getValueShown()
FormComponentgetValueShown in interface FormComponentpublic boolean isValueShownModified()
FormComponentisValueShownModified in interface FormComponentpublic void clearValueShownModified()
FormComponentclearValueShownModified in interface FormComponentpublic void setSmartValueEntered(boolean smartValueEntered)
FormComponentsetSmartValueEntered in interface FormComponentsmartValueEntered - true if optimize, false if always update the modelpublic boolean isSmartValueEntered()
FormComponentisSmartValueEntered in interface FormComponentTentackle - distributed, domain- and model-driven