import "io/console";
PromptHandler is used for providing dynamic functionality in console prompts.
Implementations of prompts can access the internal properties using the PromptHandlerImpl class.
static function create(): PromptHandler
static function create(max_history_size: Integer): PromptHandler
function set_replacement_char(char: Integer)
0
to disable showing the length of the password. The default value is -1
. When this
feature is used special security precautions are used.
function get_replacement_char(): Integer
function set_max_length(size: Integer)
0x7FFFFFFF
(the maximum length).
function get_max_length(): Integer
function set_search_label(label: String)
%s
at the
place where you want to show the current search text. Use %%
to display a single
%
character.
function get_search_label(): String
function is_done(): Boolean
function set_text(text: String)
function set_text(text: String, cursor: Integer)
function set_cursor(cursor: Integer)
function get_text(): String
function get_cursor(): Integer
function get_choice(cnt: Integer): Integer
virtual function get_history_size(): Integer
virtual function get_history_value(idx: Integer): String
virtual function add_history_value(value: String)
virtual function get_completion(input: String): String
get_choice
method to obtain the current choice based on the number of valid choices. The returned value is the
whole input string including the completion. You can also return null
in case there
are no completion choices available.
virtual function handle_completion(): Boolean
get_completion
method. Allows more control about the completion: it can change the whole text and move the cursor at
any position. Returns true when a completion was provided.
virtual function handle_event(event: ConsoleEvent): Boolean