public abstract class ChoiceManager
extends java.lang.Object
implements java.awt.event.KeyListener, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected int |
choiceLimit |
Constructor and Description |
---|
ChoiceManager(MustTextField textField)
Constructs a new choice manager.
|
ChoiceManager(MustTextField textField,
Callback callback)
Constructs a new choice manager.
|
ChoiceManager(MustTextField textField,
int minLengthForSearch,
int choiceLimit,
Callback callback)
Constructs a new choice manager.
|
Modifier and Type | Method and Description |
---|---|
protected abstract java.util.Vector<java.lang.String> |
getChoice(java.lang.String fragment) |
int |
getMinLengthForSearch() |
protected boolean |
isStillRelevant() |
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
void |
run() |
static void |
setActive(boolean active) |
void |
setMinLengthForSearch(int minLengthForSearch) |
void |
setOwner(java.awt.Window owner) |
public ChoiceManager(MustTextField textField)
textField
- the text field whose input is to be completed.public ChoiceManager(MustTextField textField, Callback callback)
textField
- the text field whose input is to be completed.callback
- the callback after user has chosenpublic ChoiceManager(MustTextField textField, int minLengthForSearch, int choiceLimit, Callback callback)
textField
- the text field whose input is to be completed.minLengthForSearch
- the minimum length of user input to start a search for possible choiceschoiceLimit
- the maximum of choices to list - if more items exist there will be no choice listpublic static void setActive(boolean active)
public int getMinLengthForSearch()
public void setOwner(java.awt.Window owner)
public void setMinLengthForSearch(int minLengthForSearch)
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void run()
run
in interface java.lang.Runnable
protected abstract java.util.Vector<java.lang.String> getChoice(java.lang.String fragment)
protected boolean isStillRelevant()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de