Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdesktop.swingx.autocomplete
Class AutoCompleteDocument

    java.lang.Object
      org.jdesktop.swingx.autocomplete.AutoCompleteDocument

All Implemented Interfaces:
  javax.swing.text.Document

Direct Known Subclasses:
  AutoCompleteStyledDocument

    public class AutoCompleteDocument

extends java.lang.Object
implements javax.swing.text.Document

A document that can be plugged into any JTextComponent to enable automatic completion. It finds and selects matching items using any implementation of the AbstractAutoCompleteAdaptor.

Field Summary
`protected javax.swing.text.Document` | `delegate`
`protected boolean` | `strictMatching` true, if only items from the adaptors's list can be entered false, otherwise (selected item might not be in the adaptors's list)

Fields inherited from interface javax.swing.text.Document
`StreamDescriptionProperty, TitleProperty`

Constructor Summary
`AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching)` Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
`AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter)` Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.
`AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor, boolean strictMatching, ObjectToStringConverter stringConverter, javax.swing.text.Document delegate)` Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.

Method Summary
`void` | `addDocumentListener(javax.swing.event.DocumentListener listener)`
`void` | `addUndoableEditListener(javax.swing.event.UndoableEditListener listener)`
`protected javax.swing.text.Document` | `createDefaultDocument()` Creates the default backing document when no delegate is passed to this document.
`javax.swing.text.Position` | `createPosition(int offs)`
`javax.swing.text.Element` | `getDefaultRootElement()`
`javax.swing.text.Position` | `getEndPosition()`
`int` | `getLength()`
`java.lang.Object` | `getProperty(java.lang.Object key)`
`javax.swing.text.Element[]` | `getRootElements()`
`javax.swing.text.Position` | `getStartPosition()`
`java.lang.String` | `getText(int offset, int length)`
`void` | `getText(int offset, int length, javax.swing.text.Segment txt)`
`void` | `insertString(int offs, java.lang.String str, javax.swing.text.AttributeSet a)`
`boolean` | `isStrictMatching()` Returns if only items from the adaptor's list should be allowed to be entered.
`void` | `putProperty(java.lang.Object key, java.lang.Object value)`
`void` | `remove(int offs, int len)`
`void` | `removeDocumentListener(javax.swing.event.DocumentListener listener)`
`void` | `removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)`
`void` | `render(java.lang.Runnable r)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### strictMatching

    protected boolean strictMatching

  true, if only items from the adaptors's list can be entered false, otherwise (selected item might not be in the adaptors's list)

### delegate

    protected final javax.swing.text.Document delegate

Constructor Detail

### AutoCompleteDocument

    public AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
                                boolean strictMatching,
                                ObjectToStringConverter stringConverter,
                                javax.swing.text.Document delegate)

  Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.

  Parameters:
    `adaptor` - The adaptor that will be used to find and select matching items.
    `strictMatching` - true, if only items from the adaptor's list should be allowed to be entered
    `stringConverter` - the converter used to transform items to strings
    `delegate` - the `Document` delegate backing this document

### AutoCompleteDocument

    public AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
                                boolean strictMatching,
                                ObjectToStringConverter stringConverter)

  Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.

  Parameters:
    `adaptor` - The adaptor that will be used to find and select matching items.
    `strictMatching` - true, if only items from the adaptor's list should be allowed to be entered
    `stringConverter` - the converter used to transform items to strings

### AutoCompleteDocument

    public AutoCompleteDocument(AbstractAutoCompleteAdaptor adaptor,
                                boolean strictMatching)

  Creates a new AutoCompleteDocument for the given AbstractAutoCompleteAdaptor.

  Parameters:
    `strictMatching` - true, if only items from the adaptor's list should be allowed to be entered
    `adaptor` - The adaptor that will be used to find and select matching items.

Method Detail

### createDefaultDocument

    protected javax.swing.text.Document createDefaultDocument()

  Creates the default backing document when no delegate is passed to this document.

  Returns:
    the default backing document

### remove

    public void remove(int offs,
                       int len)
                throws javax.swing.text.BadLocationException

  Specified by:
    `remove` in interface `javax.swing.text.Document`
  Throws:
    `javax.swing.text.BadLocationException`

### insertString

    public void insertString(int offs,
                             java.lang.String str,
                             javax.swing.text.AttributeSet a)
                      throws javax.swing.text.BadLocationException

  Specified by:
    `insertString` in interface `javax.swing.text.Document`
  Throws:
    `javax.swing.text.BadLocationException`

### addDocumentListener

    public void addDocumentListener(javax.swing.event.DocumentListener listener)

  Specified by:
    `addDocumentListener` in interface `javax.swing.text.Document`

### addUndoableEditListener

    public void addUndoableEditListener(javax.swing.event.UndoableEditListener listener)

  Specified by:
    `addUndoableEditListener` in interface `javax.swing.text.Document`

### createPosition

    public javax.swing.text.Position createPosition(int offs)
                                             throws javax.swing.text.BadLocationException

  Specified by:
    `createPosition` in interface `javax.swing.text.Document`
  Throws:
    `javax.swing.text.BadLocationException`

### getDefaultRootElement

    public javax.swing.text.Element getDefaultRootElement()

  Specified by:
    `getDefaultRootElement` in interface `javax.swing.text.Document`

### getEndPosition

    public javax.swing.text.Position getEndPosition()

  Specified by:
    `getEndPosition` in interface `javax.swing.text.Document`

### getLength

    public int getLength()

  Specified by:
    `getLength` in interface `javax.swing.text.Document`

### getProperty

    public java.lang.Object getProperty(java.lang.Object key)

  Specified by:
    `getProperty` in interface `javax.swing.text.Document`

### getRootElements

    public javax.swing.text.Element[] getRootElements()

  Specified by:
    `getRootElements` in interface `javax.swing.text.Document`

### getStartPosition

    public javax.swing.text.Position getStartPosition()

  Specified by:
    `getStartPosition` in interface `javax.swing.text.Document`

### getText

    public java.lang.String getText(int offset,
                                    int length)
                             throws javax.swing.text.BadLocationException

  Specified by:
    `getText` in interface `javax.swing.text.Document`
  Throws:
    `javax.swing.text.BadLocationException`

### getText

    public void getText(int offset,
                        int length,
                        javax.swing.text.Segment txt)
                 throws javax.swing.text.BadLocationException

  Specified by:
    `getText` in interface `javax.swing.text.Document`
  Throws:
    `javax.swing.text.BadLocationException`

### putProperty

    public void putProperty(java.lang.Object key,
                            java.lang.Object value)

  Specified by:
    `putProperty` in interface `javax.swing.text.Document`

### removeDocumentListener

    public void removeDocumentListener(javax.swing.event.DocumentListener listener)

  Specified by:
    `removeDocumentListener` in interface `javax.swing.text.Document`

### removeUndoableEditListener

    public void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)

  Specified by:
    `removeUndoableEditListener` in interface `javax.swing.text.Document`

### render

    public void render(java.lang.Runnable r)

  Specified by:
    `render` in interface `javax.swing.text.Document`

### isStrictMatching

    public boolean isStrictMatching()

  Returns if only items from the adaptor's list should be allowed to be entered.

  Returns:
    if only items from the adaptor's list should be allowed to be entered

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.