org.jvnet.lafwidget.combo
Class ComboboxAutoCompletionWidget

java.lang.Object
  extended by org.jvnet.lafwidget.LafWidgetAdapter
      extended by org.jvnet.lafwidget.combo.ComboboxAutoCompletionWidget
All Implemented Interfaces:
LafWidget

public class ComboboxAutoCompletionWidget
extends LafWidgetAdapter

Adds auto-completion on editable combo boxes.

Author:
Kirill Grouchnikov, Thomas Bierhance http://www.orbital-computer.de/JComboBox/, inostock, Daniel Kjellin http://www.daik.se/

Nested Class Summary
 class ComboboxAutoCompletionWidget.ComboBoxPropertyChangeHandler
           
protected  class ComboboxAutoCompletionWidget.CompletionPlainDocument
          Code contributed by Thomas Bierhance from http://www.orbital-computer.de/JComboBox/
 
Field Summary
protected  ComboboxAutoCompletionWidget.ComboBoxPropertyChangeHandler changeHandler
          Property change handler on enabled property.
protected  javax.swing.JComboBox comboBox
           
protected  java.awt.event.ActionListener completionActionListener
           
protected  ComboboxAutoCompletionWidget.CompletionPlainDocument completionDocument
           
protected  java.beans.PropertyChangeListener completionPropertyListener
           
protected  java.awt.Component editor
           
protected  java.awt.event.FocusListener editorFocusListener
           
protected  java.awt.event.KeyListener editorKeyListener
           
protected  boolean hidePopupOnFocusLoss
           
protected  boolean hitBackspace
           
protected  boolean hitBackspaceOnSelection
           
protected  javax.swing.ComboBoxModel model
           
protected  javax.swing.ActionMap oldActionMap
           
protected  boolean selecting
           
 
Fields inherited from class org.jvnet.lafwidget.LafWidgetAdapter
jcomp
 
Fields inherited from interface org.jvnet.lafwidget.LafWidget
ANIMATION_KIND, COMBO_BOX_AUTOCOMPLETION_MATCHER, COMBO_BOX_NO_AUTOCOMPLETION, COMBO_BOX_USE_MODEL_ONLY, COMPONENT_PREVIEW_PAINTER, IGNORE_GLOBAL_LOCALE, NO_LOCK_ICON, PASSWORD_STRENGTH_CHECKER, TABBED_PANE_PREVIEW_PAINTER, TEXT_EDIT_CONTEXT_MENU, TEXT_FLIP_SELECT_ON_ESCAPE, TEXT_SELECT_ON_FOCUS, TREE_AUTO_DND_SUPPORT
 
Constructor Summary
ComboboxAutoCompletionWidget()
           
 
Method Summary
protected  void installEditor(java.awt.Component c)
           
 void installListeners()
          Installs listeners for the associated component.
protected  void installTextEditor(javax.swing.text.JTextComponent c)
           
 void installUI()
          Installs UI on the associated component.
 boolean isSimple()
           
 boolean requiresCustomLafSupport()
          Returns indication whether this widget requires custom LAF support.
 void setComponent(javax.swing.JComponent jcomp)
          Associates a component with this widget.
 void uninstallListeners()
          Uninstalls listeners for the associated component.
protected  void uninstallTextEditor(javax.swing.text.JTextComponent e)
           
 
Methods inherited from class org.jvnet.lafwidget.LafWidgetAdapter
installComponents, installDefaults, uninstallComponents, uninstallDefaults, uninstallUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comboBox

protected javax.swing.JComboBox comboBox

changeHandler

protected ComboboxAutoCompletionWidget.ComboBoxPropertyChangeHandler changeHandler
Property change handler on enabled property.


model

protected javax.swing.ComboBoxModel model

editor

protected java.awt.Component editor

selecting

protected boolean selecting

hidePopupOnFocusLoss

protected boolean hidePopupOnFocusLoss

hitBackspace

protected boolean hitBackspace

hitBackspaceOnSelection

protected boolean hitBackspaceOnSelection

completionActionListener

protected java.awt.event.ActionListener completionActionListener

completionPropertyListener

protected java.beans.PropertyChangeListener completionPropertyListener

editorKeyListener

protected java.awt.event.KeyListener editorKeyListener

editorFocusListener

protected java.awt.event.FocusListener editorFocusListener

completionDocument

protected ComboboxAutoCompletionWidget.CompletionPlainDocument completionDocument

oldActionMap

protected javax.swing.ActionMap oldActionMap
Constructor Detail

ComboboxAutoCompletionWidget

public ComboboxAutoCompletionWidget()
Method Detail

isSimple

public boolean isSimple()

setComponent

public void setComponent(javax.swing.JComponent jcomp)
Description copied from interface: LafWidget
Associates a component with this widget.

Specified by:
setComponent in interface LafWidget
Overrides:
setComponent in class LafWidgetAdapter
Parameters:
jcomp - Component.

installUI

public void installUI()
Description copied from interface: LafWidget
Installs UI on the associated component.

Specified by:
installUI in interface LafWidget
Overrides:
installUI in class LafWidgetAdapter

installListeners

public void installListeners()
Description copied from interface: LafWidget
Installs listeners for the associated component.

Specified by:
installListeners in interface LafWidget
Overrides:
installListeners in class LafWidgetAdapter

installTextEditor

protected void installTextEditor(javax.swing.text.JTextComponent c)

uninstallListeners

public void uninstallListeners()
Description copied from interface: LafWidget
Uninstalls listeners for the associated component.

Specified by:
uninstallListeners in interface LafWidget
Overrides:
uninstallListeners in class LafWidgetAdapter

uninstallTextEditor

protected void uninstallTextEditor(javax.swing.text.JTextComponent e)

installEditor

protected void installEditor(java.awt.Component c)

requiresCustomLafSupport

public boolean requiresCustomLafSupport()
Description copied from interface: LafWidget
Returns indication whether this widget requires custom LAF support. Some widgets such as TabOverviewDialogWidget or TabHoverPreviewWidget require custom implementation based on the internals of the specific LAF. Relevant functions in the base LafWidgetSupport support throw UnsupportedOperationException.

Returns:
true if this widget requires custom LAF support, false otherwise.