public class StringFormField extends AbstractFormField
JTextField.AccessibleJTextFieldJTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBindingJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyerrorMessage, errorOffset, savedValuenotifyActionDEFAULT_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 |
|---|
StringFormField()
Creates an empty StringFormField with miminum width
using the default document model.
|
StringFormField(Document doc,
String str,
int columns)
Creates a StringFormField.
Notice: setting doc != null requires a doc derived from FormFieldDocument. |
StringFormField(int columns)
Creates an empty StringFormField using the default document model.
|
StringFormField(String str,
int columns)
Creates a StringFormField using the default document model.
|
| Modifier and Type | Method and Description |
|---|---|
String |
doFormat(Object object)
The format will be ignored in StringFormFields.
|
String |
getFormat()
The format will be ignored in StringFormFields.
|
String |
getFormValue()
Retrieves the value from this component.
The method is used to update the data model if the view has changed because the user edited it. |
String |
getText()
Gets the text from the view of this component.
|
boolean |
isNullIfEmpty()
Returns whether empty strings should be returned as null.
|
void |
setFormat(String pattern)
The format will be ignored in StringFormFields.
|
void |
setFormValue(Object object)
Sets a value in this component.
The method is used to update the view if the data has changed. |
void |
setNullIfEmpty(boolean nullIfEmpty)
Sets whether empty strings should be returned as null.
|
void |
setText(String str)
Sets the given text in the view of this component.
|
addValueListener, clearText, clearValueShownModified, createDefaultModel, downRight, fireValueChanged, fireValueEntered, getAdjust, getBinding, getBindingPath, getComponentPath, getConvert, getConverter, getDefaultColumns, getErrorMessage, getErrorOffset, getFiller, getFocusTraversalGroup, getHelpURL, getInvalidChars, getMaxColumns, getParentWindow, getPreferredSize, getPropertyGroup, getToolTipText, getValidChars, getValueShown, getVerticalAlignment, hideErrorPopup, invalidateParentInfo, isAutoNext, isAutoSelect, isAutoUpdate, isBindable, isCaretLeft, isCaretRight, isCellEditorUsage, isChangeable, isEmpty, isEraseFirst, isFireRunning, isFormTraversable, isHonourChangeable, isInhibitAutoSelect, isMandatory, isOverwrite, isSmartValueEntered, isStartEditLeftmost, isTriggerValueChangedEnabled, isValueChanged, isValueShownModified, prepareFocusLost, processFocusEvent, processKeyBinding, removeValueListener, requestFocusLater, restoreSavedValue, saveValue, setAdjust, setAutoNext, setAutoSelect, setAutoUpdate, setBindable, setBinding, setBindingPath, setCaretLeft, setCaretRight, setCellEditorUsage, setChangeable, setColumns, setComponentPath, setConvert, setConverter, setDefaultColumns, setEditable, setEraseFirst, setErrorMessage, setErrorOffset, setFiller, setFireRunning, setFocusTraversalGroup, setFormTraversable, setFormWrapWindow, setHelpURL, setHonourChangeable, setInhibitAutoSelect, setInvalidChars, setMandatory, setMaxColumns, setOverwrite, setPropertyGroup, setSmartValueEntered, setStartEditLeftmost, setTriggerValueChangedEnabled, setValidChars, setVerticalAlignment, showErrorPopup, showErrorPopup, showHelp, transferFocus, transferFocusBackward, triggerValueChanged, updateAllChangeable, upLeft, wasFocusGainedFromTransfer, wasFocusGainedFromTransferBackward, wasTransferFocus, wasTransferFocusBackward, wasTransferFocusByEnteractionPropertyChanged, 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, waitgetCaretPosition, getColumns, getHorizontalAlignment, postActionEvent, setCaretPosition, setHorizontalAlignment, setToolTipTextgetBaseline, hasFocuspublic StringFormField(Document doc, String str, int columns)
doc - the document model, null = defaultstr - the initial text, null = emptycolumns - the number of columns, 0 = minimum widthpublic StringFormField(String str, int columns)
str - the initial text, null = emptycolumns - the number of columns, 0 = minimum widthpublic StringFormField(int columns)
columns - the number of columns, 0 = minimum widthpublic StringFormField()
public void setNullIfEmpty(boolean nullIfEmpty)
nullIfEmpty - true if zero-length input is treated as null (default)public boolean isNullIfEmpty()
public void setFormValue(Object object)
Sets the form to the string value of given object
object - is the object to setpublic String getFormValue()
FormComponentpublic void setText(String str)
Overridden to turn off autoNext during inserts and to implement eraseFirst.
Overridden to replace the null string with the empty string
setText in interface FormFieldComponentsetText in class AbstractFormFieldstr - the textpublic String getText()
Overridden because of text adjustment.
Overridden because of nullIfEmpty
getText in interface FormFieldComponentgetText in class AbstractFormFieldpublic void setFormat(String pattern)
pattern - the format stringpublic String getFormat()
Tentackle - a domain driven enterprise framework