Add ability to register trigger characters
Status: Beta
Brought to you by:
wgedeon
The service is setup with a char[] of trigger characters, some characters are not allowed such as '\n' which is already bound to notifyNewLine(), or '\' which is used for the escape function, etc. Throw an IllegalTriggerCharacterException.
Add Prompt.hasTrigger(), Prompt.hasCtrl(), char getTrigger() and char getCtrlChar(). (also properly fill those values when the default trigger char '\n' is sent in a notifyNewLine.)
Make sure the character check order is not disturbed by this collective check for trigger.
Check if insert, home, end, etc can be registered as triggers.
Use RFC1184 - Telnet Linemode Option.
Tab becomes a trigger character that must be registered, in the case of autocomplete.
It would also mean that autocomplete ought to make it configurable, defaulted to tab.
The extension's action listener interface will be extended with an Spi version that provides the service access to the characters it wants to be notified of. This will allow reduction of code polution :-) as well as increase performance: getTriggers(), and getCtrlChars().
Checked at extension registration, which can throw a TriggerAlreadyReservedException or CtrlCharAlreadyReservedException (with the name of the extension).