public class FormFieldComponentPanel extends FormComponentPanel implements FormFieldComponent
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, 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_UCABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
FormFieldComponentPanel()
Creates a
FormFieldComponentPanel for a StringFormField. |
FormFieldComponentPanel(FormFieldComponent comp)
Creates a
FormFieldComponentPanel for a given FormFieldComponent. |
| 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.
|
FormFieldComponent |
getFormComponent()
Gets the embedded form field component.
|
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 columns)
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 format)
Sets the format string.
The format string is used to format the view of the data. |
void |
setHorizontalAlignment(int align)
Sets the horizontal alignment.
|
void |
setInhibitAutoSelect(boolean inhibitAutoSelect)
Sets auto-select to be inhibited inhibited (once).
|
void |
setInvalidChars(String str)
Sets invalid characters.
|
void |
setMaxColumns(int columns)
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 str)
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, isChangeable, isFireRunning, isFormTraversable, isHonourChangeable, isMandatory, isSmartValueEntered, isTriggerValueChangedEnabled, isValueChanged, isValueShownModified, prepareFocusLost, removeValueListener, requestFocus, requestFocus, requestFocusInWindow, requestFocusLater, saveValue, setAutoUpdate, setBindable, setBinding, setBindingPath, setCellEditorUsage, setChangeable, setComponentPath, setFireRunning, setFocusTraversalGroup, setFormComponent, setFormTraversable, setFormValue, setFormWrapWindow, setHelpURL, setHonourChangeable, setMandatory, setPropertyGroup, setSmartValueEntered, setTriggerValueChangedEnabled, showErrorPopup, showHelp, triggerValueChanged, updateAllChangeable, wasFocusGainedFromTransfer, wasFocusGainedFromTransferBackward, wasTransferFocus, wasTransferFocusBackward, wasTransferFocusByEnteraddActionListener, areValuesChanged, componentAdded, componentRemoved, createBinder, fireActionPerformed, getBinder, getFormValues, getTitle, isTriggerValuesChangedEnabled, removeActionListener, saveValues, setFormValues, setFormValuesKeepChanged, setTitle, setTriggerValuesChangedEnabled, triggerValuesChangedgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, 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, addInputMethodListener, 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, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddValueListener, 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, setHonourChangeablepublic FormFieldComponentPanel(FormFieldComponent comp)
FormFieldComponentPanel for a given FormFieldComponent.comp - the componentpublic FormFieldComponentPanel()
FormFieldComponentPanel for a StringFormField.public FormFieldComponent getFormComponent()
getFormComponent in class FormComponentPanelpublic void setColumns(int columns)
FormFieldComponentsetColumns in interface FormFieldComponentcolumns - the number of columns ≥ 0public int getColumns()
FormFieldComponentgetColumns in interface FormFieldComponentpublic void setFormat(String format)
FormFieldComponentsetFormat in interface FormFieldComponentformat - the format stringpublic String getFormat()
FormFieldComponentgetFormat in interface FormFieldComponentpublic String doFormat(Object object)
FormFieldComponentdoFormat in interface FormFieldComponentobject - the objectpublic void clearText()
FormFieldComponentclearText in interface FormFieldComponentpublic boolean isEmpty()
FormFieldComponentisEmpty in interface FormFieldComponentpublic void setText(String str)
FormFieldComponentsetText in interface FormFieldComponentstr - the textpublic String getText()
FormFieldComponentgetText in interface FormFieldComponentpublic void setEraseFirst(boolean erasefirst)
FormFieldComponentsetEraseFirst in interface FormFieldComponenterasefirst - true to clear after first setTextpublic boolean isEraseFirst()
FormFieldComponentisEraseFirst in interface FormFieldComponentpublic void setMaxColumns(int columns)
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 FormFieldComponentcolumns - the maximum number of columns, 0 if unlimited (default)public int getMaxColumns()
FormFieldComponentgetMaxColumns in interface FormFieldComponentpublic void setDefaultColumns(int columns)
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 FormFieldComponentcolumns - the default columnspublic int getDefaultColumns()
FormFieldComponentgetDefaultColumns in interface FormFieldComponentpublic void setConvert(char convert)
FormFieldComponentsetConvert in interface FormFieldComponentconvert - one of FormField.CONVERT_...public char getConvert()
FormFieldComponentgetConvert in interface FormFieldComponentpublic void setConverter(Function<String,String> converter)
FormFieldComponentsetConverter in interface FormFieldComponentconverter - the converter, null if none (default)public Function<String,String> getConverter()
FormFieldComponentgetConverter 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 setValidChars(String str)
FormFieldComponentsetValidChars in interface FormFieldComponentstr - the valid characters, null = all (default)public String getValidChars()
FormFieldComponentgetValidChars in interface FormFieldComponentpublic void setInvalidChars(String str)
FormFieldComponentsetInvalidChars in interface FormFieldComponentstr - 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 boolean isInhibitAutoSelect()
FormFieldComponentisInhibitAutoSelect in interface FormFieldComponentpublic void setInhibitAutoSelect(boolean inhibitAutoSelect)
FormFieldComponentsetInhibitAutoSelect in interface FormFieldComponentinhibitAutoSelect - true if inhibitedpublic boolean isCaretLeft()
FormFieldComponentisCaretLeft in interface FormFieldComponentpublic boolean isCaretRight()
FormFieldComponentisCaretRight in interface FormFieldComponentpublic void setCaretPosition(int pos)
FormFieldComponentsetCaretPosition in interface FormFieldComponentpos - the caret position, 0 = start of fieldpublic int getCaretPosition()
FormFieldComponentgetCaretPosition in interface FormFieldComponentpublic void setHorizontalAlignment(int align)
FormFieldComponentsetHorizontalAlignment in interface FormFieldComponentalign - the alignmentComponentpublic int getHorizontalAlignment()
FormFieldComponentgetHorizontalAlignment in interface FormFieldComponentComponentpublic void setVerticalAlignment(int alignment)
FormFieldComponentsetVerticalAlignment in interface FormFieldComponentalignment - the vertical alignmentpublic int getVerticalAlignment()
FormFieldComponentgetVerticalAlignment in interface FormFieldComponentpublic void setCaretLeft()
FormFieldComponentsetCaretLeft in interface FormFieldComponentpublic void setCaretRight()
FormFieldComponentsetCaretRight in interface FormFieldComponentpublic void upLeft()
FormFieldComponentupLeft in interface FormFieldComponentpublic void downRight()
FormFieldComponentdownRight in interface FormFieldComponentpublic void postActionEvent()
FormFieldComponentpostActionEvent in interface FormFieldComponentpublic void setToolTipText(String text)
FormFieldComponentsetToolTipText in interface FormFieldComponentsetToolTipText in class JComponenttext - the tooltip text, null = nonepublic String getToolTipText()
FormFieldComponentgetToolTipText in interface FormFieldComponentgetToolTipText in class JComponentTentackle - a domain driven enterprise framework