|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fedmest.cw.keyboard.KeyboardUtils
com.fedmest.cw.keyboard.internal.KeyboardUtilsDefImpl
public final class KeyboardUtilsDefImpl
This class is the default implementation of KeyboardUtils
. It prompts the user for input with -->
and signals an
error with a !
prefix. It also allows users to cancel a cancelable input by typing nothing and pressing <enter>
.
The class is not meant to be used directly, but serves as an example of how to create your subclasses of KeyboardUtils
.
It is also the implementation returned by the KeyboardUtils.newDefaultKeyboard()
method.
Constructor Summary | |
---|---|
KeyboardUtilsDefImpl()
|
Method Summary | |
---|---|
protected java.lang.String |
addErrTag(java.lang.String msg)
Adds the error tag to a string. |
protected java.lang.String |
addPrompt(java.lang.String msg)
Adds the input prompt to a string. |
protected boolean |
shouldCancel(java.lang.String txt)
Checks whether a cancel sequence was typed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyboardUtilsDefImpl()
Method Detail |
---|
protected java.lang.String addErrTag(java.lang.String msg)
KeyboardUtils
addErrTag
in class KeyboardUtils
msg
- the message that should be combined with the error tag character sequence.
protected java.lang.String addPrompt(java.lang.String msg)
KeyboardUtils
KeyboardUtils
to specify how the
error tag combines with the error message.
addPrompt
in class KeyboardUtils
msg
- the message that should be combined with the input prompt character sequence.
protected boolean shouldCancel(java.lang.String txt)
KeyboardUtils
KeyboardUtils
to specify
whether the string typed by the user is a request to cancel current input. This method will not be invoked by the framework
if the instance if not cancelable and canceling will not be possible.
shouldCancel
in class KeyboardUtils
txt
- the message that the user type on the keyboard.
true
if the string means the user intends to cancel input,false
if the string is not a request to
cancel and should be validated and possibly converted before returning it.KeyboardUtils.isCancelable()
,
KeyboardUtils.setCancelable(boolean)
,
KeyboardUtils.wasCanceled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |