info.joseluismartin.gui.action
Class AutoCompletionListener

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by info.joseluismartin.gui.action.AutoCompletionListener
All Implemented Interfaces:
KeyListener, EventListener
Direct Known Subclasses:
FilterAutoCompletionListener

public abstract class AutoCompletionListener
extends KeyAdapter

JComboBox Listener that refresh the list of items based on text that is typed on the ComboBoxEditor. Implement abstract getList() to provide the new item list.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Constructor Summary
AutoCompletionListener()
           
AutoCompletionListener(JComboBox combo)
          Create a new AutocompletionListener and attach it to combo
 
Method Summary
 JComboBox getCombo()
           
protected abstract  List<?> getList(String editing)
           
 void keyReleased(KeyEvent e)
          
 void keyTyped(KeyEvent e)
           
 void setCombo(JComboBox combo)
           
 
Methods inherited from class java.awt.event.KeyAdapter
keyPressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoCompletionListener

public AutoCompletionListener()

AutoCompletionListener

public AutoCompletionListener(JComboBox combo)
Create a new AutocompletionListener and attach it to combo

Parameters:
combo - combobox to add the auto completion listener
Method Detail

keyReleased

public void keyReleased(KeyEvent e)

Specified by:
keyReleased in interface KeyListener
Overrides:
keyReleased in class KeyAdapter

getList

protected abstract List<?> getList(String editing)
Parameters:
editing - String
Returns:
a List of objects with match editing string

getCombo

public JComboBox getCombo()

setCombo

public void setCombo(JComboBox combo)

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener
Overrides:
keyTyped in class KeyAdapter


Copyright © 2013 JDAL. All Rights Reserved.