info.joseluismartin.gui.action
Class FilterAutoCompletionListener

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

public class FilterAutoCompletionListener
extends AutoCompletionListener

AutoComletionListener based on PersistentService and PatternFilter

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

Field Summary
static String DEFAULT_SORT_PROPERTY
           
 
Constructor Summary
FilterAutoCompletionListener()
           
FilterAutoCompletionListener(JComboBox combo)
          Create and add the autocompletion listener to JComboBox
FilterAutoCompletionListener(JComboBox combo, int maxValue)
          Create and add the autocompletion listener to JComboBox
FilterAutoCompletionListener(JComboBox combo, int maxResults, String sortProperty)
          Create and add the autocompletion listener to JComboBox
 
Method Summary
protected  List getList(String editing)
           
 int getMaxResults()
           
 PersistentService getPersistentService()
           
 String getSortProperty()
           
 void setMaxResults(int maxResults)
           
 void setPersistentService(PersistentService persistentService)
           
 void setSortProperty(String sortProperty)
           
 
Methods inherited from class info.joseluismartin.gui.action.AutoCompletionListener
getCombo, keyReleased, keyTyped, setCombo
 
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
 

Field Detail

DEFAULT_SORT_PROPERTY

public static final String DEFAULT_SORT_PROPERTY
See Also:
Constant Field Values
Constructor Detail

FilterAutoCompletionListener

public FilterAutoCompletionListener()

FilterAutoCompletionListener

public FilterAutoCompletionListener(JComboBox combo)
Create and add the autocompletion listener to JComboBox

Parameters:
combo - the combo to add autocompletion

FilterAutoCompletionListener

public FilterAutoCompletionListener(JComboBox combo,
                                    int maxValue)
Create and add the autocompletion listener to JComboBox

Parameters:
combo - the combo to add autocompletion-
maxValue - maximun number of results.

FilterAutoCompletionListener

public FilterAutoCompletionListener(JComboBox combo,
                                    int maxResults,
                                    String sortProperty)
Create and add the autocompletion listener to JComboBox

Parameters:
combo - the combo to add autocompletion-
maxResults - maximun number of results.
sortProperty - property for ordering, by default "name".
Method Detail

getList

protected List getList(String editing)
Specified by:
getList in class AutoCompletionListener
Parameters:
editing - String
Returns:
a List of objects with match editing string

getPersistentService

public PersistentService getPersistentService()
Returns:
the persistentService

setPersistentService

public void setPersistentService(PersistentService persistentService)
Parameters:
persistentService - the persistentService to set

getMaxResults

public int getMaxResults()
Returns:
the maxResults

setMaxResults

public void setMaxResults(int maxResults)
Parameters:
maxResults - the maxResults to set

getSortProperty

public String getSortProperty()
Returns:
the sortProperty

setSortProperty

public void setSortProperty(String sortProperty)
Parameters:
sortProperty - the sortProperty to set


Copyright © 2013 JDAL. All Rights Reserved.