|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.binding.adapter.BasicComponentFactory
com.jgoodies.validation.tutorial.util.ExampleComponentFactory
public final class ExampleComponentFactory
Consists only of static methods that vend formatted text fields used to edit dates that are bound to an underlying ValueModel. Extends the Binding library's BasicComponentFactory to inherit all factory methods from that class.
BasicComponentFactory
,
Bindings
Method Summary | |
---|---|
static JFormattedTextField |
createDateField(com.jgoodies.binding.value.ValueModel valueModel)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel . |
static JFormattedTextField |
createDateField(com.jgoodies.binding.value.ValueModel valueModel,
boolean enableShortcuts)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel . |
static JFormattedTextField |
createDateField(com.jgoodies.binding.value.ValueModel valueModel,
boolean enableShortcuts,
boolean commitsOnValidEdit)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel . |
Methods inherited from class com.jgoodies.binding.adapter.BasicComponentFactory |
---|
createCheckBox, createColorChooser, createColorChooser, createComboBox, createComboBox, createFormattedTextField, createFormattedTextField, createFormattedTextField, createFormattedTextField, createIntegerField, createIntegerField, createIntegerField, createIntegerField, createIntegerField, createLabel, createLabel, createList, createList, createLongField, createLongField, createLongField, createLongField, createLongField, createPasswordField, createPasswordField, createRadioButton, createTextArea, createTextArea, createTextField, createTextField |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel)
ValueModel
.
The JFormattedTextField is configured with an AbstractFormatter
that uses two different DateFormats to edit and display the Date.
A SHORT
DateFormat with strict checking is used to edit
(parse) a date; the DateFormatter's default DateFormat is used to
display (format) a date. In both cases null
Dates are
mapped to the empty String.
In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".
Yesterday, today, and tomorrow are displayed as these Strings, not as formatted Dates.
valueModel
- the model that holds the value to be edited
NullPointerException
- if the model is null
public static JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel, boolean enableShortcuts)
ValueModel
.
The JFormattedTextField is configured with an AbstractFormatter
that uses two different DateFormats to edit and display the Date.
A SHORT
DateFormat with strict checking is used to edit
(parse) a date; the DateFormatter's default DateFormat is used to
display (format) a date. In both cases null
Dates are
mapped to the empty String.
In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".
If enableShortcuts
is set to true
,
yesterday, today, and tomorrow are displayed as these Strings,
not as formatted Dates.
valueModel
- the model that holds the value to be editedenableShortcuts
- true to display yesterday, today, and tomorrow
with natural language strings
NullPointerException
- if the model is null
public static JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel, boolean enableShortcuts, boolean commitsOnValidEdit)
ValueModel
.
The JFormattedTextField is configured with an AbstractFormatter
that uses two different DateFormats to edit and display the Date.
A SHORT
DateFormat with strict checking is used to edit
(parse) a date; the DateFormatter's default DateFormat is used to
display (format) a date. In both cases null
Dates are
mapped to the empty String.
In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".
If enableShortcuts
is set to true
,
yesterday, today, and tomorrow are displayed as these Strings,
not as formatted Dates.
valueModel
- the model that holds the value to be editedenableShortcuts
- true to display yesterday, today, and tomorrow
with natural language stringscommitsOnValidEdit
- true to commit on valid edit,
false to commit on focus lost
NullPointerException
- if the model is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |