bee
UserInterface
Interactive user interface.
CUI
UserInterface
The for command line user interface.
TRACE
int
Message type magic number.
DEBUG
int
Message type magic number.
INFO
int
Message type magic number.
WARNING
int
Message type magic number.
ERROR
int
Message type magic number.
TITLE
int
Message type magic number.
PROGRESS
int
Message type magic number.
UserInterface
()
title
(CharSequence
title
)
void
CharSequence
title
)CharSequence title |
Talk to user with decoration like title.
progress
(CharSequence
message
)
void
CharSequence
message
)CharSequence message |
Your message. |
Talk to user as progress message.
trace
(Object
messages
)
void
Object
messages
)Object messages |
Your message. |
Talk to user.
debug
(Object
messages
)
void
Object
messages
)Object messages |
Your message. |
Talk to user.
info
(Object
messages
)
void
Object
messages
)Object messages |
Your message. |
Talk to user.
warn
(Object
messages
)
void
Object
messages
)Object messages |
Your warning message. |
Warn to user.
error
(Object
messages
)
void
Object
messages
)Object messages |
Your emergency message. |
Declare a state of emergency.
confirm
(String
question
)
boolean
String
question
)String question |
Your question message. |
boolean |
An answer. |
Ask user about your question and return his/her answer.
ask
(String
question
)
String
String
question
)String question |
Your question message. |
String |
An answer. |
Ask user about your question and return his/her answer.
ask
(String
question
, PredicateString
validator
)
String
String
question
, PredicateString
validator
)String question |
Your question message. |
Predicate validator |
Input validator. |
String |
An answer. |
Ask user about your question and return his/her answer.
ask
(String
question
, T
defaultAnswer
)
T
String
question
, T
defaultAnswer
)T |
Anwser type. |
String question |
Your question message. |
T defaultAnswer |
A default anwser. |
T |
An answer. |
Ask user about your question and return his/her answer.
UserInterface can display a default answer and user can use it with simple action. If the returned answer is incompatible with the default anwser type, default answer will be returned.
ask
(String
question
, T
defaultAnswer
, PredicateT
validator
)
T
String
question
, T
defaultAnswer
, PredicateT
validator
)T |
Anwser type. |
String question |
Your question message. |
T defaultAnswer |
A default anwser. |
Predicate validator |
Input validator. |
T |
An answer. |
Ask user about your question and return his/her answer.
UserInterface can display a default answer and user can use it with simple action. If the returned answer is incompatible with the default anwser type, default answer will be returned.
ask
(String
question
, ClassE
enumeration
)
E
String
question
, ClassE
enumeration
)E
|
|
String question |
Your question message. |
Class enumeration |
A list of selectable items. |
E |
A selected item. |
Ask user about your question and return his/her selected item.
UserInterface can display a list of items and user can select it with simple action.
ask
(String
question
, ListT
items
)
T
String
question
, ListT
items
)T |
|
String question |
Your question message. |
List items |
A list of selectable items. |
T |
A selected item. |
Ask user about your question and return his/her selected item.
UserInterface can display a list of items and user can select it with simple action.
ask
(String
question
, ListT
items
, FunctionT
, String
naming
)
T
String
question
, ListT
items
, FunctionT
, String
naming
)T |
|
String question |
Your question message. |
List items |
A list of selectable items. |
Function naming |
|
T |
A selected item. |
Ask user about your question and return his/her selected item.
UserInterface can display a list of items and user can select it with simple action.
file
(String
question
)
Path
String
question
)String question |
Your question message. |
Path |
A specified location. |
Ask user about your question and return his/her specified location.
UserInterface can display the file chooser and user can select it with simple action.
file
(String
question
, Path
defaultFile
)
Path
String
question
, Path
defaultFile
)String question |
Your question message. |
Path defaultFile |
|
Path |
A specified location. |
Ask user about your question and return his/her specified location.
UserInterface can display the file chooser and user can select it with simple action.
directory
(String
question
)
Path
String
question
)String question |
Your question message. |
Path |
A specified location. |
Ask user about your question and return his/her specified location.
UserInterface can display the directory chooser and user can select it with simple action.
directory
(String
question
, Path
defaultDirectory
)
Path
String
question
, Path
defaultDirectory
)String question |
Your question message. |
Path defaultDirectory |
|
Path |
A specified location. |
Ask user about your question and return his/her specified location.
UserInterface can display the directory chooser and user can select it with simple action.
buildMessage
(StringBuilder
builder
, Object
value
)
void
StringBuilder
builder
, Object
value
)StringBuilder builder |
A message builder. |
Object value |
A message object. |
Helper method to build message.
getInterface
()
Appendable
Appendable |
Get underlaying message listener.
getSink
()
InputStream
InputStream |
Get underlaying message sink.
write
(int
type
, String
message
)
void
int
type
, String
message
)int type |
|
String message |
Write message to user.
write
(Throwable
error
)
void
Throwable
error
)Throwable error |
Write error message to user.
startCommand
(String
name
)
void
String
name
)String name |
A command name. |
Display message about command starts.
endCommand
(String
name
)
void
String
name
)String name |
A command name. |
Display message about command ends.