|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.swing.ListKeyInputHandler
Keystroke handler for lists to select entries by typing the beginnings of the entries. This handler object allows convenient navigation through JList objects by keyboard. It listens to key strokes and forms a compare string out of them which is compared against the elements of the list. On uniqueness or when at least one (the first) matching element is found, it is selected. The whole process is case insensitive.
The compare string is shown in the lists by inverse presentation of the matching characters of the entries. For this, a special cell renderer object is used which has its own UI delegate. These objects are realized as static subclasses of ListKeyInputHandler. The delegate is inserted into the UI manager tables on loading the class the first time.
Nested Class Summary | |
static class |
ListKeyInputHandler.BasicKIHCellRendererUI
UI delegate with implementation. |
static class |
ListKeyInputHandler.KIHCellRenderer
The cell renderer object for the ListKeyInputHandler. |
static class |
ListKeyInputHandler.KIHCellRendererUI
Generic UI delegate class. |
Field Summary | |
private java.lang.String |
comparestring
|
static int |
FIRST_ALWAYS
Always select the first matching element. |
private int |
firstselectableindex
|
private javax.swing.JList |
mylist
|
private boolean |
selected
|
private int |
selectstrategy
|
static int |
UNIQUE_ONLY
Select only if the compare string is unique. |
Constructor Summary | |
private |
ListKeyInputHandler(javax.swing.JList listx,
int sx)
Constructs a new object. |
Method Summary | |
static ListKeyInputHandler |
bindToList(javax.swing.JList x)
Bind handler to a list. |
static ListKeyInputHandler |
bindToList(javax.swing.JList x,
int sx)
Bind handler to a list. |
private void |
checkCompareString(boolean forceselect)
Checks whether the compare string leads to a new selection. |
private void |
dropCompareString()
Drops the compare string. |
private java.lang.String |
getCompareString()
Returns the compare string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNIQUE_ONLY
public static final int FIRST_ALWAYS
private javax.swing.JList mylist
private java.lang.String comparestring
private int selectstrategy
private int firstselectableindex
private boolean selected
Constructor Detail |
private ListKeyInputHandler(javax.swing.JList listx, int sx)
Method Detail |
public static ListKeyInputHandler bindToList(javax.swing.JList x, int sx)
public static ListKeyInputHandler bindToList(javax.swing.JList x)
private void dropCompareString()
private void checkCompareString(boolean forceselect)
private java.lang.String getCompareString()
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |