org.tbee.swing
Class AutoCompleter

java.lang.Object
  extended by org.tbee.swing.AutoCompleter
Direct Known Subclasses:
AutoCompleter.FileAutoCompleter, AutoCompleter.ListAutoCompleter

public abstract class AutoCompleter
extends Object

This class adds autocompletion on a JTextField. Some implementations are available as inner classes o.a. ListAutoCompleter. Example: lJTextField = new JTextField(20); new ListAutoCompleter(lJTextField, Arrays.asList(new String[] { "JFC", "JSF", "JSP", "JAXP", "JDBC", "J2EE" })); lContainer.add(lJTextField);

Version:
$Revision: 1.6 $

Nested Class Summary
static class AutoCompleter.FileAutoCompleter
          Autocomplete using the file system
static class AutoCompleter.ListAutoCompleter
          Autocomplete from a list
 
Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
AutoCompleter(JTextComponent comp)
           
 
Method Summary
protected abstract  void acceptedListItem(String selected)
           
protected  void selectNextPossibleValue()
          Selects the next item in the list.
protected  void selectPreviousPossibleValue()
          Selects the previous item in the list.
protected abstract  boolean updateListData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

AutoCompleter

public AutoCompleter(JTextComponent comp)
Method Detail

selectNextPossibleValue

protected void selectNextPossibleValue()
Selects the next item in the list. It won't change the selection if the currently selected item is already the last item.


selectPreviousPossibleValue

protected void selectPreviousPossibleValue()
Selects the previous item in the list. It won't change the selection if the currently selected item is already the first item.


updateListData

protected abstract boolean updateListData()

acceptedListItem

protected abstract void acceptedListItem(String selected)


Copyright © 2011 KnowledgePlaza. All Rights Reserved.