|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.JFormattedTextField.AbstractFormatter javax.swing.text.DefaultFormatter javax.swing.text.InternationalFormatter javax.swing.text.DateFormatter
DateFormatter is an InternationalFormatter
that does its
formatting by way of an instance of java.text.DateFormat
.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
DateFormat
,
Serialized FormNested Class Summary |
Nested classes inherited from class javax.swing.text.InternationalFormatter |
InternationalFormatter.ExtendedReplaceHolder |
Nested classes inherited from class javax.swing.text.DefaultFormatter |
DefaultFormatter.ReplaceHolder |
Field Summary |
Fields inherited from class javax.swing.text.InternationalFormatter |
|
Fields inherited from class javax.swing.text.DefaultFormatter |
replaceHolder |
Fields inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
|
Constructor Summary | |
DateFormatter()
This is shorthand for new DateFormatter(DateFormat.getDateInstance()) . |
|
DateFormatter(DateFormat format)
Returns a DateFormatter configured with the specified Format instance. |
Method Summary | |
(package private) Object |
adjustValue(Object value,
Map attributes,
Object key,
int direction)
Adjusts the Date if FieldPosition identifies a known calendar field. |
(package private) Object |
getAdjustField(int start,
Map attributes)
Returns the field that will be adjusted by adjustValue. |
private Calendar |
getCalendar()
Returns the Calendar that DateFormat is associated with,
or if the Format is not a DateFormat
Calendar.getInstance is returned. |
(package private) boolean |
getSupportsIncrement()
Returns true, as DateFormatterFilter will support incrementing/decrementing of the value. |
void |
setFormat(DateFormat format)
Sets the format that dictates the legal values that can be edited and displayed. |
Methods inherited from class javax.swing.text.InternationalFormatter |
canIncrement, canReplace, clone, getActions, getAttributes, getAttributeStart, getBufferedChar, getFields, getFormat, getIterator, getLiteral, getLiteralCountTo, getMaximum, getMinimum, getReplaceHolder, install, isLiteral, isLiteral, isNavigatable, isValidMask, isValidValue, replace, replace, resetValue, selectField, setFormat, setMaximum, setMinimum, stringToValue, stringToValue, updateMask, updateMaskIfNecessary, updateValue, valueToString |
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
getFormattedTextField, invalidEdit, setEditValid, uninstall |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DateFormatter()
new DateFormatter(DateFormat.getDateInstance())
.
public DateFormatter(DateFormat format)
Format
instance.
format
- Format used to dictate legal valuesMethod Detail |
public void setFormat(DateFormat format)
If you have used the nullary constructor the value of this property
will be determined for the current locale by way of the
Dateformat.getDateInstance()
method.
format
- DateFormat instance used for converting from/to Stringsprivate Calendar getCalendar()
DateFormat
is associated with,
or if the Format
is not a DateFormat
Calendar.getInstance
is returned.
boolean getSupportsIncrement()
getSupportsIncrement
in class InternationalFormatter
Object getAdjustField(int start, Map attributes)
getAdjustField
in class InternationalFormatter
Object adjustValue(Object value, Map attributes, Object key, int direction) throws BadLocationException, ParseException
adjustValue
in class InternationalFormatter
BadLocationException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |