API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. InternationalFormatter View Source
Author(s)
Since
1.4
Version
1.7 04/09/01
Serial
Hierarchy
 Object
      JFormattedTextField.AbstractFormatter
          DefaultFormatter
              InternationalFormatter
Implements
Subclasses
Description
public class InternationalFormatter
  InternationalFormatter extends DefaultFormatter, using an instance of java.text.Format to handle the conversion to a String, and the conversion from a String.
See also:    Format Comparable
Constructors
public InternationalFormatter ()
Creates an InternationalFormatter with no Format specified.
public InternationalFormatter (Format format)
  Creates an InternationalFormatter with the specified Format instance.
Methods
Hide/Show inherited methods
pack-private Object adjustValue (Object value, Map attributes, Object field, int direction) throws BadLocationException ParseException
  Subclasses supporting incrementing must override this to handle the actual incrementing.
pack-private boolean canIncrement (Object field, int cursorPosition)
  Returns true if field is non-null.
pack-private boolean canReplace (ReplaceHolder rh) [Overrides DefaultFormatter]
  Overriden in an attempt to honor the literals.
public Object clone () throws CloneNotSupportedException [Overrides DefaultFormatter]
  Creates a copy of the DefaultFormatter.
pack-private void commitEdit () throws ParseException [Inherited From DefaultFormatter]
Invokes commitEdit on the JFormattedTextField.
protected Action getActions () [Overrides JFormattedTextField.AbstractFormatter]
If getSupportsIncrement returns true, this returns two Actions suitable for incrementing/decrementing the value.
pack-private Object getAdjustField (int start, Map attributes)
Returns the field that will be adjusted by adjustValue.
public boolean getAllowsInvalid () [Inherited From DefaultFormatter]
  Returns whether or not the value being edited is allowed to be invalid for a length of time.
pack-private Map getAttributes (int index)
Returns a Set of the attribute identifiers at index.
pack-private int getAttributeStart (Attribute id)
  Returns the start of the first run that contains the attribute id.
pack-private char getBufferedChar (int index)
Returns the character from the mask that has been buffered at index.
public boolean getCommitsOnValidEdit () [Inherited From DefaultFormatter]
  Returns when edits are published back to the JFormattedTextField.
protected DocumentFilter getDocumentFilter () [Inherited From DefaultFormatter]
  Returns the DocumentFilter used to restrict the characters that can be input into the JFormattedTextField.
public Field getFields (int offset)
  Returns the Format.Field constants associated with the text at offset.
public Format getFormat ()
  Returns the format that dictates the legal values that can be edited and displayed.
protected JFormattedTextField getFormattedTextField () [Inherited From JFormattedTextField.AbstractFormatter]
  Returns the current JFormattedTextField the AbstractFormatter is installed on.
pack-private int getInitialVisualPosition () [Inherited From DefaultFormatter]
  Returns the initial location to position the cursor at.
pack-private AttributedCharacterIterator getIterator ()
Returns the AttributedCharacterIterator used to format the last value.
pack-private char getLiteral (int index)
Returns the literal character at index.
pack-private int getLiteralCountTo (int index)
Returns the number of literal characters before index.
public Comparable getMaximum ()
  Returns the maximum permissible value.
public Comparable getMinimum ()
  Returns the minimum permissible value.
protected NavigationFilter getNavigationFilter () [Inherited From DefaultFormatter]
  Returns the NavigationFilter used to restrict where the cursor can be placed.
pack-private int getNextCursorPosition (int offset, int direction) [Inherited From DefaultFormatter]
  Returns the next cursor position from offset by incrementing direction.
pack-private int getNextVisualPositionFrom (JTextComponent text, int pos, Bias bias, int direction, Bias biasRet) throws BadLocationException [Inherited From DefaultFormatter]
Finds the next navigatable character.
public boolean getOverwriteMode () [Inherited From DefaultFormatter]
  Returns the behavior when inserting characters.
pack-private ReplaceHolder getReplaceHolder (FilterBypass fb, int offset, int length, String text, AttributeSet attrs) [Overrides DefaultFormatter]
Overriden to return an instance of ExtendedReplaceHolder.
pack-private String getReplaceString (int offset, int deleteLength, String replaceString) [Inherited From DefaultFormatter]
A convenience methods to return the result of deleting deleteLength characters at offset and inserting replaceString at offset in the current text field.
pack-private boolean getSupportsIncrement ()
  Returns false, indicating InternationalFormatter does not allow incrementing of the value.
public Class<Object> getValueClass () [Inherited From DefaultFormatter]
  Returns that class that is used to create new Objects.
public void install (JFormattedTextField ftf) [Overrides DefaultFormatter]
  Installs the DefaultFormatter onto a particular JFormattedTextField.
protected void invalidEdit () [Inherited From JFormattedTextField.AbstractFormatter]
  This should be invoked when the user types an invalid character.
pack-private boolean isLegalInsertText (String text) [Inherited From DefaultFormatter]
  Returns true if the text in text can be inserted.
pack-private boolean isLiteral (int index)
Returns true if the character at index is a literal, that is not editable.
pack-private boolean isLiteral (Map attributes)
Returns true if attributes is null or empty.
pack-private boolean isNavigatable (int offset) [Overrides DefaultFormatter]
  Returns true if the character at offset is navigatable too.
pack-private boolean isValidEdit (ReplaceHolder rh) [Inherited From DefaultFormatter]
pack-private boolean isValidMask ()
Returns true if the current mask is valid.
pack-private boolean isValidValue (Object value, boolean wantsCCE)
  Returns true if value is between the min/max.
pack-private void moveDot (FilterBypass fb, int dot, Bias bias) [Inherited From DefaultFormatter]
NavigationFilter method, subclasses that wish finer control should override this.
pack-private void positionCursorAtInitialLocation () [Inherited From DefaultFormatter]
Positions the cursor at the initial location.
pack-private boolean replace (ReplaceHolder rh) throws BadLocationException [Overrides DefaultFormatter]
  When in !allowsInvalid mode the text is reset on every edit, thus supers implementation will position the cursor at the wrong position.
pack-private void replace (FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException [Overrides DefaultFormatter]
Overriden to unconditionally allow the replace if ignoreDocumentMutate is true.
pack-private void repositionCursor (int offset, int direction) [Inherited From DefaultFormatter]
Resets the cursor by using getNextCursorPosition.
pack-private void resetValue (Object value) throws BadLocationException ParseException
Resets the value of the JFormattedTextField to be value.
pack-private void selectField (Object f, int count)
Selects the fields identified by attributes.
public void setAllowsInvalid (boolean allowsInvalid) [Inherited From DefaultFormatter]
  Sets whether or not the value being edited is allowed to be invalid for a length of time (that is, stringToValue throws a ParseException).
public void setCommitsOnValidEdit (boolean commit) [Inherited From DefaultFormatter]
  Sets when edits are published back to the JFormattedTextField.
pack-private void setDot (FilterBypass fb, int dot, Bias bias) [Inherited From DefaultFormatter]
NavigationFilter method, subclasses that wish finer control should override this.
protected void setEditValid (boolean valid) [Inherited From JFormattedTextField.AbstractFormatter]
  Invoke this to update the editValid property of the JFormattedTextField.
public void setFormat (Format format)
  Sets the format that dictates the legal values that can be edited and displayed.
public void setMaximum (Comparable max)
  Sets the maximum permissible value.
public void setMinimum (Comparable minimum)
  Sets the minimum permissible value.
public void setOverwriteMode (boolean overwriteMode) [Inherited From DefaultFormatter]
  Configures the behavior when inserting characters.
public void setValueClass (Class<Object> valueClass) [Inherited From DefaultFormatter]
  Sets that class that is used to create new Objects.
public Object stringToValue (String text) throws ParseException [Overrides DefaultFormatter] [Specified in JFormattedTextField.AbstractFormatter]
  Returns the Object representation of the String text.
pack-private Object stringToValue (String text, Format f) throws ParseException
Invokes parseObject on f, returning its value.
public void uninstall () [Inherited From JFormattedTextField.AbstractFormatter]
  Uninstalls any state the AbstractFormatter may have installed on the JFormattedTextField.
pack-private void updateMask ()
  Updates the AttributedCharacterIterator by invoking formatToCharacterIterator on the Format.
pack-private void updateMaskIfNecessary ()
Updates the AttributedCharacterIterator and bitset, if necessary.
pack-private void updateValue () [Inherited From DefaultFormatter]
Pushes the value to the JFormattedTextField if the current value is valid and invokes setEditValid based on the validity of the value.
pack-private void updateValue (Object value) [Overrides DefaultFormatter]
Overriden to update the mask after invoking supers implementation.
public String valueToString (Object value) throws ParseException [Overrides DefaultFormatter] [Specified in JFormattedTextField.AbstractFormatter]
  Returns a String representation of the Object value.
Fields
Hide/Show inherited fields
pack-privatetransient ReplaceHolder replaceHolder [Inherited From DefaultFormatter]
Used during replace to track the region to replace.
Nested Classes
  InternationalFormatter.ExtendedReplaceHolder
As InternationalFormatter replaces the complete text on every edit, ExtendedReplaceHolder keeps track of the offset and length passed into canReplace.
  DefaultFormatter.ReplaceHolder
ReplaceHolder is used to track where insert/remove/replace is going to happen.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar