|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
org.tentackle.ui.FormComboBox
org.tentackle.ui.FormFieldComboBox
public class FormFieldComboBox
A FormFieldComboBox is a FormComboBox with a
FormFieldComponent as its editor.
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.tentackle.ui.FormFieldComponent |
|---|
getBaseline |
| Constructor Detail |
|---|
public FormFieldComboBox(FormField editorField)
FormFielComboBox for a given FormField.
editorField - the FormField used as the editor field and formatting
null, if standard StringFormFieldpublic FormFieldComboBox()
FormFielComboBox for a default StringFormField.
public FormFieldComboBox(FormField editorField,
Object[] items)
FormFielComboBox for a given FormField.
editorField - the FormField used for editing and formatting,
null if standard StringFormFielditems - the array of itemspublic FormFieldComboBox(Object[] items)
FormFielComboBox for a default StringFormField.
items - the array of items| Method Detail |
|---|
public void setEditorField(FormField editorField)
editorField - the FormField used for editing and formatting,
null if standard StringFormFieldpublic FormField getEditorField()
public boolean requestFocusInWindow()
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.
requestFocusInWindow in class JComponentfalse if the focus change request is guaranteed to
fail; true if it is likely to succeedComponent.requestFocusInWindow(),
Component.requestFocusInWindow(boolean)public void requestFocus()
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.
requestFocus in class JComponentComponent.requestFocusInWindow(),
Component.requestFocusInWindow(boolean)public void setToolTipText(String text)
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.
setToolTipText in interface FormFieldComponentsetToolTipText in class JComponenttext - the string to display; if the text is null,
the tool tip is turned off for this componentJComponent.TOOL_TIP_TEXT_KEYpublic String getToolTipText()
setToolTipText.
Overridden to get the tooltip from the editorfield. This allows editable comboboxes handle tooltips the same way as non-editable.
getToolTipText in interface FormFieldComponentgetToolTipText in class FormComboBoxJComponent.TOOL_TIP_TEXT_KEYpublic boolean wasTransferFocus()
FormComponentFormComponent.transferFocus().
wasTransferFocus in interface FormComponentwasTransferFocus in class FormComboBoxpublic boolean wasTransferFocusBackward()
FormComponentFormComponent.transferFocusBackward().
wasTransferFocusBackward in interface FormComponentwasTransferFocusBackward in class FormComboBoxpublic boolean wasFocusGainedFromTransfer()
FormComponentFormComponent.transferFocus()
in the opposite component.
wasFocusGainedFromTransfer in interface FormComponentwasFocusGainedFromTransfer in class FormComboBoxFormFocusTraversalPolicypublic boolean wasFocusGainedFromTransferBackward()
FormComponentFormComponent.transferFocusBackward()
in the opposite component.
wasFocusGainedFromTransferBackward in interface FormComponentwasFocusGainedFromTransferBackward in class FormComboBoxFormFocusTraversalPolicypublic boolean wasTransferFocusByEnter()
FormComponentKeyEvent.VK_ENTER.
wasTransferFocusByEnter in interface FormComponentwasTransferFocusByEnter in class FormComboBoxpublic void fireValueEntered()
valueEntered-handler.note: valueEntered will *ONLY* be fired if the last actionEvent did not fire for the same selectedItem (see fireActionEvent)
Overridden to setFormValueText
fireValueEntered in interface FormComponentfireValueEntered in class FormComboBoxpublic void focusLost(FocusEvent e)
Overridden to show the value if editable.
focusLost in interface FocusListenerfocusLost in class FormComboBoxe - the focus lost eventpublic boolean setFormValueText(String text)
FormComboBox
setFormValueText in class FormComboBoxtext - the string to match
public void setFormat(String format)
FormFieldComponent
setFormat in interface FormFieldComponentformat - the format stringpublic String getFormat()
FormFieldComponent
getFormat in interface FormFieldComponentpublic void setColumns(int columns)
FormFieldComponent
setColumns in interface FormFieldComponentcolumns - the number of columns ≥ 0public int getColumns()
FormFieldComponent
getColumns in interface FormFieldComponentpublic void setAutoSelect(boolean autoselect)
FormFieldComponent
setAutoSelect in interface FormFieldComponentautoselect - true if autoselect enabled, false if disabled (default)public boolean isAutoSelect()
FormFieldComponent
isAutoSelect in interface FormFieldComponentpublic void setAutoNext(boolean autonext)
FormFieldComponent
setAutoNext in interface FormFieldComponentautonext - true if autonext enabled, false if disabled (default)public boolean isAutoNext()
FormFieldComponent
isAutoNext in interface FormFieldComponentpublic void setAutoUpdate(boolean autoupdate)
FormFieldComponent
setAutoUpdate in interface FormFieldComponentautoupdate - true if auto update the data (default), false if notpublic boolean isAutoUpdate()
FormFieldComponent
isAutoUpdate in interface FormFieldComponentpublic void setConvert(char convert)
FormFieldComponent
setConvert in interface FormFieldComponentconvert - one of FormField.CONVERT_...public char getConvert()
FormFieldComponent
getConvert in interface FormFieldComponentpublic void setAdjust(char adjust)
FormFieldComponent
setAdjust in interface FormFieldComponentadjust - one of FormField.ADJUST_...FormFieldComponent.setFiller(char)public void setConverter(StringConverter converter)
FormFieldComponentStringConverter may be set to translate
characters.
setConverter in interface FormFieldComponentconverter - the converter, null if none (default)public StringConverter getConverter()
FormFieldComponent
getConverter in interface FormFieldComponentpublic char getAdjust()
FormFieldComponent
getAdjust in interface FormFieldComponentpublic void setMaxColumns(int columns)
FormFieldComponent
setMaxColumns in interface FormFieldComponentcolumns - the maximum number of columns, 0 if unlimited (default)public int getMaxColumns()
FormFieldComponent
getMaxColumns in interface FormFieldComponentpublic void setFiller(char filler)
FormFieldComponent
setFiller in interface FormFieldComponentfiller - the fill characterFormFieldComponent.setAdjust(char)public char getFiller()
FormFieldComponent
getFiller in interface FormFieldComponentpublic void setOverwrite(boolean override)
FormFieldComponent
setOverwrite in interface FormFieldComponentoverride - true if override, false if insert (default)public boolean isOverwrite()
FormFieldComponent
isOverwrite in interface FormFieldComponentpublic void setValidChars(String str)
FormFieldComponent
setValidChars in interface FormFieldComponentstr - the valid characters, null = all (default)public String getValidChars()
FormFieldComponent
getValidChars in interface FormFieldComponentpublic void setInvalidChars(String str)
FormFieldComponent
setInvalidChars in interface FormFieldComponentstr - the invalid characters, null = none (default)public String getInvalidChars()
FormFieldComponent
getInvalidChars in interface FormFieldComponentpublic void setEraseFirst(boolean erasefirst)
FormFieldComponent
setEraseFirst in interface FormFieldComponenterasefirst - true to clear after first setTextpublic boolean isEraseFirst()
FormFieldComponent
isEraseFirst in interface FormFieldComponentpublic void setCaretPosition(int pos)
FormFieldComponent
setCaretPosition in interface FormFieldComponentpos - the caret position, 0 = start of fieldpublic int getCaretPosition()
FormFieldComponent
getCaretPosition in interface FormFieldComponentpublic boolean isCaretLeft()
FormFieldComponent
isCaretLeft in interface FormFieldComponentpublic boolean isCaretRight()
FormFieldComponent
isCaretRight in interface FormFieldComponentpublic void setHorizontalAlignment(int alignment)
FormFieldComponent
setHorizontalAlignment in interface FormFieldComponentalignment - the alignmentComponentpublic int getHorizontalAlignment()
FormFieldComponent
getHorizontalAlignment in interface FormFieldComponentComponentpublic void setVerticalAlignment(int alignment)
FormFieldComponent
setVerticalAlignment in interface FormFieldComponentalignment - the vertical alignmentpublic int getVerticalAlignment()
FormFieldComponent
getVerticalAlignment in interface FormFieldComponentpublic void requestFocusLater()
FormComponent
requestFocusLater in interface FormComponentrequestFocusLater in class FormComboBoxpublic boolean isInhibitAutoSelect()
FormFieldComponent
isInhibitAutoSelect in interface FormFieldComponentpublic void setInhibitAutoSelect(boolean inhibitAutoSelect)
FormFieldComponent
setInhibitAutoSelect in interface FormFieldComponentinhibitAutoSelect - true if inhibitedpublic void clearText()
FormFieldComponent
clearText in interface FormFieldComponentpublic void setCaretLeft()
FormFieldComponent
setCaretLeft in interface FormFieldComponentpublic void setCaretRight()
FormFieldComponent
setCaretRight in interface FormFieldComponentpublic void upLeft()
If the popup is visible the UP-key will move to the item above the current item.
upLeft in interface FormFieldComponentpublic void downRight()
If the popup is visible the DOWN-key will move to the item below the current item.
downRight in interface FormFieldComponentpublic int getErrorOffset()
FormFieldComponent
getErrorOffset in interface FormFieldComponentpublic void setText(String str)
FormFieldComponent
setText in interface FormFieldComponentstr - the textpublic String getText()
FormFieldComponent
getText in interface FormFieldComponentpublic boolean isEmpty()
FormFieldComponent
isEmpty in interface FormFieldComponentpublic String doFormat(Object object)
FormFieldComponent
doFormat in interface FormFieldComponentobject - the object
public void setStartEditLeftmost(boolean startEditLeftmost)
FormFieldComponent
setStartEditLeftmost in interface FormFieldComponentstartEditLeftmost - true if start edit leftmostpublic boolean isStartEditLeftmost()
FormFieldComponent
isStartEditLeftmost in interface FormFieldComponentpublic void doActionPerformed()
FormFieldComponent
doActionPerformed in interface FormFieldComponentpublic void saveValue()
FormComponent
saveValue in interface FormComponentsaveValue in class FormComboBoxFormComponent.isValueChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||