javax.swing
Class JSpinner.ListEditor.ListFormatter

java.lang.Object
  extended byjavax.swing.JFormattedTextField.AbstractFormatter
      extended byjavax.swing.JSpinner.ListEditor.ListFormatter
All Implemented Interfaces:
Serializable
Enclosing class:
JSpinner.ListEditor

private class JSpinner.ListEditor.ListFormatter
extends JFormattedTextField.AbstractFormatter

ListFormatter provides completion while text is being input into the JFormattedTextField. Completion is only done if the user is inserting text at the end of the document. Completion is done by way of the SpinnerListModel method findNextMatch.


Nested Class Summary
private  class JSpinner.ListEditor.ListFormatter.Filter
           
 
Field Summary
private  DocumentFilter filter
           
 
Fields inherited from class javax.swing.JFormattedTextField.AbstractFormatter
 
Constructor Summary
private JSpinner.ListEditor.ListFormatter()
           
 
Method Summary
protected  DocumentFilter getDocumentFilter()
          Subclass and override if you wish to provide a DocumentFilter to restrict what can be input.
 Object stringToValue(String string)
          Parses text returning an arbitrary Object.
 String valueToString(Object value)
          Returns the string value to display for value.
 
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter
clone, getActions, getFormattedTextField, getNavigationFilter, install, invalidEdit, setEditValid, uninstall
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

private DocumentFilter filter
Constructor Detail

JSpinner.ListEditor.ListFormatter

private JSpinner.ListEditor.ListFormatter()
Method Detail

valueToString

public String valueToString(Object value)
                     throws ParseException
Description copied from class: JFormattedTextField.AbstractFormatter
Returns the string value to display for value.

Specified by:
valueToString in class JFormattedTextField.AbstractFormatter
Parameters:
value - Value to convert
Returns:
String representation of value
Throws:
ParseException - if there is an error in the conversion

stringToValue

public Object stringToValue(String string)
                     throws ParseException
Description copied from class: JFormattedTextField.AbstractFormatter
Parses text returning an arbitrary Object. Some formatters may return null.

Specified by:
stringToValue in class JFormattedTextField.AbstractFormatter
Parameters:
string - String to convert
Returns:
Object representation of text
Throws:
ParseException - if there is an error in the conversion

getDocumentFilter

protected DocumentFilter getDocumentFilter()
Description copied from class: JFormattedTextField.AbstractFormatter
Subclass and override if you wish to provide a DocumentFilter to restrict what can be input. install will install the returned value onto the JFormattedTextField.

Overrides:
getDocumentFilter in class JFormattedTextField.AbstractFormatter
Returns:
DocumentFilter to restrict edits