org.tentackle.ui
Class FormFieldComboBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JComboBox
                  extended by org.tentackle.ui.FormComboBox
                      extended by org.tentackle.ui.FormFieldComboBox
All Implemented Interfaces:
ActionListener, FocusListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener, FormComponent, FormFieldComponent
Direct Known Subclasses:
TimeZoneComboBox, WeekdayComboBox

public class FormFieldComboBox
extends FormComboBox
implements FormFieldComponent

A FormFieldComboBox is a FormComboBox with a FormFieldComponent as its editor.

Author:
harald
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.tentackle.ui.FormComboBox
FormComboBox.MultiKeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FormFieldComboBox()
          Creates a FormFielComboBox for a default StringFormField.
FormFieldComboBox(FormField editorField)
          Creates a FormFielComboBox for a given FormField.
FormFieldComboBox(FormField editorField, Object[] items)
          Creates a FormFielComboBox for a given FormField.
FormFieldComboBox(Object[] items)
          Creates a FormFielComboBox for a default StringFormField.
 
Method Summary
 void clearText()
          Clears the contents of this component.
 void doActionPerformed()
          Invokes the action performed handler.
 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.
 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.
 void focusLost(FocusEvent e)
          Invoked when a component loses the keyboard focus.
 char getAdjust()
          Gets the current adjustment.
 int getCaretPosition()
          Gets the caret position.
 int getColumns()
          Gets the columns.
 char getConvert()
          Gets the current convesion
 StringConverter getConverter()
          Gets the current converter.
 FormField getEditorField()
          Gets the editor field.
 int getErrorOffset()
          Gets the offset in this components text for the first 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()
          Returns the tooltip string that has been set with setToolTipText.
 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 isAutoUpdate()
          Returns whether the auto-update 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 requestFocus()
          Requests that this Component gets the input focus.
 boolean requestFocusInWindow()
          Requests that this Component gets the input focus.
 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.
 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 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(StringConverter converter)
          Sets the string converter.
Besides the lower/uppercase conversion an optional StringConverter may be set to translate characters.
 void setEditorField(FormField editorField)
          Sets the editor field.
 void setEraseFirst(boolean erasefirst)
          Sets whether to erase the field after first setText().
 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.
 boolean setFormValueText(String text)
          Sets the form value by matching a given text with the objects in the selection list
Tries to find the value in the object list according to its String-representation and select it if found.
 void setHorizontalAlignment(int alignment)
          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.
 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)
          Registers the text to display in a tool tip.
 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.
 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.
 
Methods inherited from class org.tentackle.ui.FormComboBox
actionPerformed, addAllItems, addAllItems, addItem, addValueListener, fireActionEvent, fireValueChanged, focusGained, getAllItems, getFormValue, getFormValueText, getHelpURL, getItemIndexWithLeadString, getLeadKeyTimeout, getParentWindow, getPopupRenderer, invalidateParentInfo, isAllowDeselect, isCellEditorUsage, isChangeable, isFireRunning, isFormTraversable, isHonourChangeable, isMultiKeySelectionManager, isShortLongPopupEnabled, isValueAdjusting, isValueChanged, isValueEnteredOnSelect, prepareFocusLost, processKeyEvent, removeAllItems, removeValueListener, selectWithLeadString, setAllItems, setAllItems, setAllowDeselect, setCellEditorUsage, setChangeable, setEditable, setFireRunning, setFormTraversable, setFormValue, setFormValueIndex, setFormWrapWindow, setHelpURL, setHonourChangeable, setLeadKeyTimeout, setMultiKeySelectionManager, setPopupRenderer, setShortLongPopupEnabled, setValueAdjusting, setValueEnteredOnSelect, showHelp, transferFocus, transferFocusBackward, triggerValueChanged
 
Methods inherited from class javax.swing.JComboBox
actionPropertyChanged, addActionListener, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, removeActionListener, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, 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, validateTree
 
Methods inherited from class java.awt.Component
action, 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, hasFocus, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.tentackle.ui.FormFieldComponent
getBaseline
 
Methods inherited from interface org.tentackle.ui.FormComponent
addValueListener, fireValueChanged, getFormValue, getHelpURL, getParentWindow, hasFocus, invalidateParentInfo, isCellEditorUsage, isChangeable, isFireRunning, isFormTraversable, isHonourChangeable, isValueChanged, prepareFocusLost, removeValueListener, setCellEditorUsage, setChangeable, setFireRunning, setFormTraversable, setFormValue, setFormWrapWindow, setHelpURL, setHonourChangeable, showHelp, transferFocus, transferFocusBackward, triggerValueChanged
 

Constructor Detail

FormFieldComboBox

public FormFieldComboBox(FormField editorField)
Creates a FormFielComboBox for a given FormField.

Parameters:
editorField - the FormField used as the editor field and formatting null, if standard StringFormField

FormFieldComboBox

public FormFieldComboBox()
Creates a FormFielComboBox for a default StringFormField.


FormFieldComboBox

public FormFieldComboBox(FormField editorField,
                         Object[] items)
Creates a FormFielComboBox for a given FormField.

Parameters:
editorField - the FormField used for editing and formatting, null if standard StringFormField
items - the array of items

FormFieldComboBox

public FormFieldComboBox(Object[] items)
Creates a FormFielComboBox for a default StringFormField.

Parameters:
items - the array of items
Method Detail

setEditorField

public void setEditorField(FormField editorField)
Sets the editor field.

Parameters:
editorField - the FormField used for editing and formatting, null if standard StringFormField

getEditorField

public FormField getEditorField()
Gets the editor field.

Returns:
the editor field

requestFocusInWindow

public boolean requestFocusInWindow()
Requests that this Component gets the input focus. Refer to Component.requestFocusInWindow() for a complete description of this method.

If you would like more information on focus, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Overridden so that the editor field gets the focus.

Overrides:
requestFocusInWindow in class JComponent
Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
See Also:
Component.requestFocusInWindow(), Component.requestFocusInWindow(boolean)

requestFocus

public void requestFocus()
Requests that this Component gets the input focus. Refer to Component.requestFocus() for a complete description of this method.

Note that the use of this method is discouraged because its behavior is platform dependent. Instead we recommend the use of requestFocusInWindow(). If you would like more information on focus, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Overridden so that the editor field gets the focus.

Overrides:
requestFocus in class JComponent
See Also:
Component.requestFocusInWindow(), Component.requestFocusInWindow(boolean)

setToolTipText

public void setToolTipText(String text)
Registers the text to display in a tool tip. The text displays when the cursor lingers over the component.

See How to Use Tool Tips in The Java Tutorial for further documentation.

Overridden to store tooltip in editorfield. This allows editable comboboxes handle tooltips the same way as non-editable.

Specified by:
setToolTipText in interface FormFieldComponent
Overrides:
setToolTipText in class JComponent
Parameters:
text - the string to display; if the text is null, the tool tip is turned off for this component
See Also:
JComponent.TOOL_TIP_TEXT_KEY

getToolTipText

public String getToolTipText()
Returns the tooltip string that has been set with setToolTipText.

Overridden to get the tooltip from the editorfield. This allows editable comboboxes handle tooltips the same way as non-editable.

Specified by:
getToolTipText in interface FormFieldComponent
Overrides:
getToolTipText in class FormComboBox
Returns:
the text of the tool tip
See Also:
JComponent.TOOL_TIP_TEXT_KEY

wasTransferFocus

public boolean wasTransferFocus()
Description copied from interface: FormComponent
Returns whether this component lost the keyboard focus due to FormComponent.transferFocus().

Specified by:
wasTransferFocus in interface FormComponent
Overrides:
wasTransferFocus in class FormComboBox
Returns:
true if focus lost due to transferFocus

wasTransferFocusBackward

public boolean wasTransferFocusBackward()
Description copied from interface: FormComponent
Returns whether this component lost the keyboard focus due to FormComponent.transferFocusBackward().

Specified by:
wasTransferFocusBackward in interface FormComponent
Overrides:
wasTransferFocusBackward in class FormComboBox
Returns:
true if focus lost due to transferFocusBackward

wasFocusGainedFromTransfer

public boolean wasFocusGainedFromTransfer()
Description copied from interface: FormComponent
Returns whether the keyboard focus was gained due to FormComponent.transferFocus() in the opposite component.

Specified by:
wasFocusGainedFromTransfer in interface FormComponent
Overrides:
wasFocusGainedFromTransfer in class FormComboBox
Returns:
true if this component gained the focus from the logically previous component
See Also:
FormFocusTraversalPolicy

wasFocusGainedFromTransferBackward

public boolean wasFocusGainedFromTransferBackward()
Description copied from interface: FormComponent
Returns whether the keyboard focus was gained due to FormComponent.transferFocusBackward() in the opposite component.

Specified by:
wasFocusGainedFromTransferBackward in interface FormComponent
Overrides:
wasFocusGainedFromTransferBackward in class FormComboBox
Returns:
true if this component gained the focus from the logically next component
See Also:
FormFocusTraversalPolicy

wasTransferFocusByEnter

public boolean wasTransferFocusByEnter()
Description copied from interface: FormComponent
Returns whether this component lost the keyboard focus due to KeyEvent.VK_ENTER.

Specified by:
wasTransferFocusByEnter in interface FormComponent
Overrides:
wasTransferFocusByEnter in class FormComboBox
Returns:
true if pressing the Enter/Return key caused a focus lost

fireValueEntered

public 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.

note: valueEntered will *ONLY* be fired if the last actionEvent did not fire for the same selectedItem (see fireActionEvent)

Overridden to setFormValueText

Specified by:
fireValueEntered in interface FormComponent
Overrides:
fireValueEntered in class FormComboBox

focusLost

public void focusLost(FocusEvent e)
Invoked when a component loses the keyboard focus.

Overridden to show the value if editable.

Specified by:
focusLost in interface FocusListener
Overrides:
focusLost in class FormComboBox
Parameters:
e - the focus lost event

setFormValueText

public boolean setFormValueText(String text)
Description copied from class: FormComboBox
Sets the form value by matching a given text with the objects in the selection list
Tries to find the value in the object list according to its String-representation and select it if found. if no match found: just clear selectedItem but don't change contents of editor!

Overrides:
setFormValueText in class FormComboBox
Parameters:
text - the string to match
Returns:
true if some object selected, false if no such object

setFormat

public void setFormat(String format)
Description copied from interface: FormFieldComponent
Sets the format string.
The format string is used to format the view of the data.

Specified by:
setFormat in interface FormFieldComponent
Parameters:
format - the format string

getFormat

public String getFormat()
Description copied from interface: FormFieldComponent
Gets the format string.

Specified by:
getFormat in interface FormFieldComponent
Returns:
the format string

setColumns

public void setColumns(int columns)
Description copied from interface: FormFieldComponent
Sets the number of columns in this component.
The visible width is adjusted according to the current font.

Specified by:
setColumns in interface FormFieldComponent
Parameters:
columns - the number of columns ≥ 0

getColumns

public int getColumns()
Description copied from interface: FormFieldComponent
Gets the columns.

Specified by:
getColumns in interface FormFieldComponent
Returns:
the columns

setAutoSelect

public void setAutoSelect(boolean autoselect)
Description copied from interface: FormFieldComponent
Sets the auto-select feature.
A component with autoselect enabled will automatically select all characters if the component gets the keyboard focus. Useful for numerical fields, for example.

Specified by:
setAutoSelect in interface FormFieldComponent
Parameters:
autoselect - true if autoselect enabled, false if disabled (default)

isAutoSelect

public boolean isAutoSelect()
Description copied from interface: FormFieldComponent
Returns whether the auto-select feature is enabled.

Specified by:
isAutoSelect in interface FormFieldComponent
Returns:
true if autoselect enabled, false if disabled (default)

setAutoNext

public void setAutoNext(boolean autonext)
Description copied from interface: FormFieldComponent
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. Only meaningful if maxColumns > 0

Specified by:
setAutoNext in interface FormFieldComponent
Parameters:
autonext - true if autonext enabled, false if disabled (default)

isAutoNext

public boolean isAutoNext()
Description copied from interface: FormFieldComponent
Returns whether the auto-next feature is enabled.

Specified by:
isAutoNext in interface FormFieldComponent
Returns:
true if autonext enabled, false if disabled (default)

setAutoUpdate

public void setAutoUpdate(boolean autoupdate)
Description copied from interface: FormFieldComponent
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).

Specified by:
setAutoUpdate in interface FormFieldComponent
Parameters:
autoupdate - true if auto update the data (default), false if not

isAutoUpdate

public boolean isAutoUpdate()
Description copied from interface: FormFieldComponent
Returns whether the auto-update feature is enabled.

Specified by:
isAutoUpdate in interface FormFieldComponent
Returns:
true if auto update the data (default), false if not

setConvert

public void setConvert(char convert)
Description copied from interface: FormFieldComponent
Sets character upper/lowercase conversion.
Notice that changing the character conversion will immediately convert.

Specified by:
setConvert in interface FormFieldComponent
Parameters:
convert - one of FormField.CONVERT_...

getConvert

public char getConvert()
Description copied from interface: FormFieldComponent
Gets the current convesion

Specified by:
getConvert in interface FormFieldComponent
Returns:
the conversion, default is CONVERT_NONE

setAdjust

public void setAdjust(char adjust)
Description copied from interface: FormFieldComponent
Sets character adjustment.
By default the text input data is trimmed, i.e. fill characters (space by default) to the left and right are removed. This is not be mixed up with the horizontal orientation!

Specified by:
setAdjust in interface FormFieldComponent
Parameters:
adjust - one of FormField.ADJUST_...
See Also:
FormFieldComponent.setFiller(char)

setConverter

public void setConverter(StringConverter converter)
Description copied from interface: FormFieldComponent
Sets the string converter.
Besides the lower/uppercase conversion an optional StringConverter may be set to translate characters.

Specified by:
setConverter in interface FormFieldComponent
Parameters:
converter - the converter, null if none (default)

getConverter

public StringConverter getConverter()
Description copied from interface: FormFieldComponent
Gets the current converter. Default is null.

Specified by:
getConverter in interface FormFieldComponent
Returns:
the converter.

getAdjust

public char getAdjust()
Description copied from interface: FormFieldComponent
Gets the current adjustment.

Specified by:
getAdjust in interface FormFieldComponent
Returns:
the adjustment, default ADJUST_TRIM

setMaxColumns

public void setMaxColumns(int columns)
Description copied from interface: FormFieldComponent
Sets the maximum number of columns.

Specified by:
setMaxColumns in interface FormFieldComponent
Parameters:
columns - the maximum number of columns, 0 if unlimited (default)

getMaxColumns

public int getMaxColumns()
Description copied from interface: FormFieldComponent
Gets the maximum number of columns.

Specified by:
getMaxColumns in interface FormFieldComponent
Returns:
the maximum number of columns, 0 if unlimited (default)

setFiller

public void setFiller(char filler)
Description copied from interface: FormFieldComponent
Sets the fill char.
The fill char determines the adjustment of the text data.

Specified by:
setFiller in interface FormFieldComponent
Parameters:
filler - the fill character
See Also:
FormFieldComponent.setAdjust(char)

getFiller

public char getFiller()
Description copied from interface: FormFieldComponent
Gets the current fill char.

Specified by:
getFiller in interface FormFieldComponent
Returns:
the filler, default is blank (space)

setOverwrite

public void setOverwrite(boolean override)
Description copied from interface: FormFieldComponent
Sets the insert/override mode.

Specified by:
setOverwrite in interface FormFieldComponent
Parameters:
override - true if override, false if insert (default)

isOverwrite

public boolean isOverwrite()
Description copied from interface: FormFieldComponent
Gets the current override mode.

Specified by:
isOverwrite in interface FormFieldComponent
Returns:
true if override, false if insert (default)

setValidChars

public void setValidChars(String str)
Description copied from interface: FormFieldComponent
Sets allowed characters.

Specified by:
setValidChars in interface FormFieldComponent
Parameters:
str - the valid characters, null = all (default)

getValidChars

public String getValidChars()
Description copied from interface: FormFieldComponent
Gets allowed characters.

Specified by:
getValidChars in interface FormFieldComponent
Returns:
the valid characters, null = all (default)

setInvalidChars

public void setInvalidChars(String str)
Description copied from interface: FormFieldComponent
Sets invalid characters.

Specified by:
setInvalidChars in interface FormFieldComponent
Parameters:
str - the invalid characters, null = none (default)

getInvalidChars

public String getInvalidChars()
Description copied from interface: FormFieldComponent
Gets invalid characters.

Specified by:
getInvalidChars in interface FormFieldComponent
Returns:
the invalid characters, null = none (default)

setEraseFirst

public void setEraseFirst(boolean erasefirst)
Description copied from interface: FormFieldComponent
Sets whether to erase the field after first setText().

Specified by:
setEraseFirst in interface FormFieldComponent
Parameters:
erasefirst - true to clear after first setText

isEraseFirst

public boolean isEraseFirst()
Description copied from interface: FormFieldComponent
Returns whether to erase the field after first setText().

Specified by:
isEraseFirst in interface FormFieldComponent
Returns:
true to clear after first setText

setCaretPosition

public void setCaretPosition(int pos)
Description copied from interface: FormFieldComponent
Sets the caret position.

Specified by:
setCaretPosition in interface FormFieldComponent
Parameters:
pos - the caret position, 0 = start of field

getCaretPosition

public int getCaretPosition()
Description copied from interface: FormFieldComponent
Gets the caret position.

Specified by:
getCaretPosition in interface FormFieldComponent
Returns:
the caret position, 0 = start of field

isCaretLeft

public boolean isCaretLeft()
Description copied from interface: FormFieldComponent
Returns whether carat is at leftmost position.

Specified by:
isCaretLeft in interface FormFieldComponent
Returns:
true if caret is at leftmost position

isCaretRight

public boolean isCaretRight()
Description copied from interface: FormFieldComponent
Returns whether caret is at rightmost position.

Specified by:
isCaretRight in interface FormFieldComponent
Returns:
true if caret is at rightmost position

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Description copied from interface: FormFieldComponent
Sets the horizontal alignment.

Specified by:
setHorizontalAlignment in interface FormFieldComponent
Parameters:
alignment - the alignment
See Also:
Component

getHorizontalAlignment

public int getHorizontalAlignment()
Description copied from interface: FormFieldComponent
Gets the horizontal alignment.

Specified by:
getHorizontalAlignment in interface FormFieldComponent
Returns:
the horizontal alignment
See Also:
Component

setVerticalAlignment

public void setVerticalAlignment(int alignment)
Description copied from interface: FormFieldComponent
Sets the vertical alignment.
Can only be used in Tentackle-LookAndFeels!

Specified by:
setVerticalAlignment in interface FormFieldComponent
Parameters:
alignment - the vertical alignment

getVerticalAlignment

public int getVerticalAlignment()
Description copied from interface: FormFieldComponent
Gets the vertical alignment.

Specified by:
getVerticalAlignment in interface FormFieldComponent
Returns:
the vertical alignment

requestFocusLater

public void requestFocusLater()
Description copied from interface: FormComponent
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. This method guarantees that this component gets the focus when all events queued so far have been processed.

Specified by:
requestFocusLater in interface FormComponent
Overrides:
requestFocusLater in class FormComboBox

isInhibitAutoSelect

public boolean isInhibitAutoSelect()
Description copied from interface: FormFieldComponent
Returns whether auto-select is inhibited (once).

Specified by:
isInhibitAutoSelect in interface FormFieldComponent
Returns:
true if inhibited

setInhibitAutoSelect

public void setInhibitAutoSelect(boolean inhibitAutoSelect)
Description copied from interface: FormFieldComponent
Sets auto-select to be inhibited inhibited (once).

Specified by:
setInhibitAutoSelect in interface FormFieldComponent
Parameters:
inhibitAutoSelect - true if inhibited

clearText

public void clearText()
Description copied from interface: FormFieldComponent
Clears the contents of this component.

Specified by:
clearText in interface FormFieldComponent

setCaretLeft

public void setCaretLeft()
Description copied from interface: FormFieldComponent
Sets the caret to leftmost position.

Specified by:
setCaretLeft in interface FormFieldComponent

setCaretRight

public void setCaretRight()
Description copied from interface: FormFieldComponent
Sets the caret to rightmost position.

Specified by:
setCaretRight in interface FormFieldComponent

upLeft

public void upLeft()
Move caret to the left side of field and if already there move to previous field.

If the popup is visible the UP-key will move to the item above the current item.

Specified by:
upLeft in interface FormFieldComponent

downRight

public void downRight()
Move the caret to the right side of field and if already there move to next field.

If the popup is visible the DOWN-key will move to the item below the current item.

Specified by:
downRight in interface FormFieldComponent

getErrorOffset

public int getErrorOffset()
Description copied from interface: FormFieldComponent
Gets the offset in this components text for the first error.

Specified by:
getErrorOffset in interface FormFieldComponent
Returns:
the error offset, -1 if no error

setText

public void setText(String str)
Description copied from interface: FormFieldComponent
Sets the given text in the view of this component.

Specified by:
setText in interface FormFieldComponent
Parameters:
str - the text

getText

public String getText()
Description copied from interface: FormFieldComponent
Gets the text from the view of this component.

Specified by:
getText in interface FormFieldComponent
Returns:
the text

isEmpty

public boolean isEmpty()
Description copied from interface: FormFieldComponent
Determines whether this component is empty.

Specified by:
isEmpty in interface FormFieldComponent
Returns:
true if empty

doFormat

public String doFormat(Object object)
Description copied from interface: FormFieldComponent
Does the formatting of the given object.
Renders the object and returns the string.

Specified by:
doFormat in interface FormFieldComponent
Parameters:
object - the object
Returns:
the formatted object as a string

setStartEditLeftmost

public void setStartEditLeftmost(boolean startEditLeftmost)
Description copied from interface: FormFieldComponent
Sets whether to start edit leftmost in this component (once).

Specified by:
setStartEditLeftmost in interface FormFieldComponent
Parameters:
startEditLeftmost - true if start edit leftmost

isStartEditLeftmost

public boolean isStartEditLeftmost()
Description copied from interface: FormFieldComponent
Returns whether to start edit leftmost in this component (once).

Specified by:
isStartEditLeftmost in interface FormFieldComponent
Returns:
true if start edit leftmost

doActionPerformed

public void doActionPerformed()
Description copied from interface: FormFieldComponent
Invokes the action performed handler.

Specified by:
doActionPerformed in interface FormFieldComponent

saveValue

public void saveValue()
Description copied from interface: FormComponent
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.

Specified by:
saveValue in interface FormComponent
Overrides:
saveValue in class FormComboBox
See Also:
FormComponent.isValueChanged()


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de