Hi.
I developed a kind of UI elements library based on the features of jline2 and jansi. It is inspired by InquirerJS which - in my eyes - has a very nice user interface for simple console interactions. Because I didn't find anything in the java world comparable to InquirerJS, I wrote a that library for my projects.
To get an idea what it looks like, you can find a screen recording at
YouTube. The project can be found on
https://github.com/awegmann/consoleui. Console UI itself is also a wrapper around jline2 and supports the use of completers within its InputPrompt class.
At the moment I'm stuck at implementing some features I would like to have. And maybe someone can help me - preferably by giving me some hints or adding the necessary method calls to jline2.
The first feature I want to add is a pre-filled input line. This would be used to present a default value to the user to edited. I didn't find out how to fill the input buffer of jline2 and (!) place the cursor at the end of the input buffer. Another benefit from this feature would be, that this enables me to provide validators for my InputPromt class which can be used to verify if the user entered a correct email address, IP address, URL or whatever the developer wanted the user to ask (with verification and error message).
The second feature I would like to have is an "official" API method to get one character from jline2 or a key press for a "special character" like cursor up, cursor down, enter, ESC, and so on. My class ConsoleReaderImpl provides such a functionality, but it was implemented by copying some code form the readLine method. I think this is definitely the wrong way. Is there such a API an I only didn't find it?
Best Regards
Andreas