|
||||||||||
| 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.NumberFormField
public abstract class NumberFormField
Abstract base class for all numeric form fields.
| 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 | |
|---|---|
protected DecimalFormat |
format
the decimal format |
| 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 | |
|---|---|
NumberFormField()
Creates an empty NumberFormField with the default document model, and minimum column width. |
|
NumberFormField(Document doc,
int columns)
Creates a NumberFormField. Notice: setting doc != null requires a doc derived from FormFieldDocument. |
|
NumberFormField(int columns)
Creates a NumberFormField with the default document model and given column width. |
|
| Method Summary | |
|---|---|
String |
doFormat(Object object)
Does the formatting of the given object. Renders the object and returns the string. |
String |
getFormat()
Gets the format string. |
int |
getScale()
Gets the current scale. |
boolean |
isBlankZero()
Returns the blankZero attribute. |
boolean |
isUnsigned()
Returns whether format is unsigned |
void |
setBlankZero(boolean blankZero)
Sets whether zero fields are displayed as empty fields. |
void |
setFormat(String pattern)
Sets the format string. The format string is used to format the view of the data. |
void |
setFormValue(Object object)
Sets a value in this component. The method is used to update the view if the data has changed. |
void |
setScale(int scale)
Changes the format according to the given scale. |
void |
setUnsigned(boolean unsigned)
Sets field to unsigned. |
void |
setValidChars(String validChars)
Sets allowed characters. |
| 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 |
|---|
getFormValue, hasFocus |
| Field Detail |
|---|
protected DecimalFormat format
| Constructor Detail |
|---|
public NumberFormField(Document doc,
int columns)
doc - the document model, null = defaultcolumns - the number of columns, 0 = minimum widthpublic NumberFormField(int columns)
columns - the number of columns, 0 = minimum widthpublic NumberFormField()
| Method Detail |
|---|
public void setFormat(String pattern)
FormFieldComponent
pattern - the format stringDecimalFormatpublic String getFormat()
FormFieldComponent
public void setFormValue(Object object)
FormComponent
object - is the object to setpublic String doFormat(Object object)
FormFieldComponent
object - the object
public void setUnsigned(boolean unsigned)
unsigned - true if unsigned, false if signedpublic boolean isUnsigned()
public void setValidChars(String validChars)
FormFieldComponent
setValidChars in interface FormFieldComponentsetValidChars in class FormFieldvalidChars - the valid characters, null = all (default)public void setBlankZero(boolean blankZero)
blankZero - true if zero values are displayed as empty field, default is falsepublic boolean isBlankZero()
public void setScale(int scale)
scale - the number of digits after the commapublic int getScale()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||