org.jdesktop.swingx.autocomplete
Class Configurator

java.lang.Object
  extended by org.jdesktop.swingx.autocomplete.Configurator

public class Configurator
extends java.lang.Object

This class contains only static utility methods that can be used to set up automatic completion for some Swing components.

Usage examples:

JComboBox comboBox = [...];
Configurator.enableAutoCompletion(comboBox);
 
JList list = [...];
JTextField textField = [...];
Configurator.enableAutoCompletion(list, textField);

Author:
Thomas Bierhance

Constructor Summary
Configurator()
           
 
Method Summary
static void configureTextComponent(javax.swing.text.JTextComponent textComponent, Document document, AbstractComponentAdaptor adaptor)
          Configures a given text component for automatic completion using the given Document and AbstractComponentAdaptor.
static void enableAutoCompletion(javax.swing.JComboBox comboBox)
          Enables automatic completion for the given JComboBox.
static void enableAutoCompletion(javax.swing.JList list, javax.swing.text.JTextComponent textComponent)
          Enables automatic completion for the given JTextComponent based on the items contained in the given JList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurator

public Configurator()
Method Detail

enableAutoCompletion

public static void enableAutoCompletion(javax.swing.JList list,
                                        javax.swing.text.JTextComponent textComponent)
Enables automatic completion for the given JTextComponent based on the items contained in the given JList. The two components will be synchronized. The automatic completion will always be strict.

Parameters:
list - a list
textComponent - the text component that will be used for automatic completion.

enableAutoCompletion

public static void enableAutoCompletion(javax.swing.JComboBox comboBox)
Enables automatic completion for the given JComboBox. The automatic completion will be strict (only items from the combo box can be selected) if the combo box is not editable.

Parameters:
comboBox - a combobox

configureTextComponent

public static void configureTextComponent(javax.swing.text.JTextComponent textComponent,
                                          Document document,
                                          AbstractComponentAdaptor adaptor)
Configures a given text component for automatic completion using the given Document and AbstractComponentAdaptor.

Parameters:
textComponent - a text component that should be configured
document - the Document to be installed on the text component
adaptor - the AbstractComponentAdaptor to be used


Copyright © 2005 Sun Microsystems All Rights Reserved.