|
||||||||||
| 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.text.JTextComponent
javax.swing.JTextField
org.tentackle.ui.FormField
org.tentackle.ui.StringFormField
public class StringFormField
A FormField for editing strings.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTextField |
|---|
JTextField.AccessibleJTextField |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
| 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 org.tentackle.ui.FormField |
|---|
ADJUST_LEFT, ADJUST_NONE, ADJUST_RIGHT, ADJUST_TRIM, CONVERT_LC, CONVERT_NONE, CONVERT_UC, errorOffset |
| Fields inherited from class javax.swing.JTextField |
|---|
notifyAction |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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 if the view has changed because the user edited it. |
String |
getText()
Returns the text contained in this TextComponent. |
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 text of this TextComponent
to the specified text. |
| 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, getCaretPosition, getColumns, getHorizontalAlignment, setCaretPosition, setHorizontalAlignment, setToolTipText |
| Methods inherited from interface org.tentackle.ui.FormComponent |
|---|
hasFocus |
| Constructor Detail |
|---|
public StringFormField(Document doc,
String str,
int columns)
doc - the document model, null = defaultstr - the initial text, null = emptycolumns - the number of columns, 0 = minimum width
public 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()
| Method Detail |
|---|
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()
FormComponent
public void setText(String str)
TextComponent
to the specified text. If the text is null
or empty, has the effect of simply deleting the old text.
When text has been inserted, the resulting caret location
is determined by the implementation of the caret class.
This method is thread safe, although most Swing methods
are not. Please see
How
to Use Threads for more information.
Note that text is not a bound property, so no PropertyChangeEvent
is fired when it changes. To listen for changes to the text,
use DocumentListener.
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 FormFieldstr - the new text to be setJTextComponent.getText(int, int),
DefaultCaretpublic String getText()
TextComponent.
If the underlying document is null,
will give a NullPointerException.
Note that text is not a bound property, so no PropertyChangeEvent
is fired when it changes. To listen for changes to the text,
use DocumentListener.
Overridden because of text adjustment.
Overridden because of nullIfEmpty
getText in interface FormFieldComponentgetText in class FormFieldJTextComponent.setText(java.lang.String)public void setFormat(String pattern)
pattern - the format stringpublic String getFormat()
public String doFormat(Object object)
object - the object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||