Public Member Functions | |
SuperJTextField () | |
SuperJTextField (int numCols) | |
SuperJTextField (String string) | |
SuperJTextField (String defaultText, int numCols) | |
void | addPossibleCompletion (String completion) |
OLD: Add an autocomplete entry, and keep track of the number of times it has been "added" to the completions list. | |
int | getExitKey () |
Asks for the last key pressed. | |
String | getInputHint () |
boolean | getLastKeyShiftDown () |
String | getText () |
void | removePossibleCompletion (String completion) |
void | setFocusGainedOnEdit (boolean foe) |
void | setInputHint (String hint) |
Set it to null to turn this feature off. | |
void | setPossibleCompletions (final List< String > possible) |
Override void | setText (String t) |
Static Public Member Functions | |
static void | main (String[] args) |
Protected Member Functions | |
Document | createDefaultModel () |
boolean | noText () |
Protected Attributes | |
boolean | inputHintShowing |
int | lastKeyCode = -1 |
Color | textColor = Color.BLACK |
Font | textFont |
Classes | |
class | SuperDocument |
This private class provides autocomplete functionality. |
As you type, the 10 nearest above, possible Entries are quickly trimmed down, due to prefix search. A typing listener needs to be installed needs to check for enter or backspace...
Features: Autocomplete, Input Hints
TODO: Implement ComboBoxEditor to allow this to be an awesome combobox editor field.
This software is distributed under the BSD License.
Definition at line 44 of file SuperJTextField.java.
SuperJTextField | ( | int | numCols | ) |
SuperJTextField | ( | String | string | ) |
string |
Definition at line 198 of file SuperJTextField.java.
References SuperJTextField.setText().
SuperJTextField | ( | String | defaultText, | |
int | numCols | |||
) |
defaultText | ||
numCols |
Definition at line 208 of file SuperJTextField.java.
References SuperJTextField.setText().
void addPossibleCompletion | ( | String | completion | ) |
OLD: Add an autocomplete entry, and keep track of the number of times it has been "added" to the completions list.
NEW: Just keep track of completions, and match with the most recent (earliest) in the list.
completion |
Definition at line 222 of file SuperJTextField.java.
Referenced by SuperJTextField.main().
int getExitKey | ( | ) |
Asks for the last key pressed.
It can be used for fun things, like... How did the user set/confirm the value, and exit this box?
Definition at line 241 of file SuperJTextField.java.
References SuperJTextField.lastKeyCode.
String getInputHint | ( | ) |
boolean getLastKeyShiftDown | ( | ) |
static void main | ( | String[] | args | ) | [static] |
args |
Definition at line 123 of file SuperJTextField.java.
References SuperJTextField.addPossibleCompletion(), SuperJTextField.setInputHint(), SuperJTextField.setInputHintFont(), and SuperJTextField.SuperJTextField().
boolean noText | ( | ) | [protected] |
Definition at line 275 of file SuperJTextField.java.
Referenced by SuperJTextField.setInputHint(), and SuperJTextField.setText().
void removePossibleCompletion | ( | String | completion | ) |
void setInputHint | ( | String | hint | ) |
Set it to null to turn this feature off.
hint |
Definition at line 295 of file SuperJTextField.java.
References SuperJTextField.noText().
Referenced by SuperJTextField.main().
void setPossibleCompletions | ( | final List< String > | possible | ) |