I was missing an autocompletion feature from the Terminal for a long time, so I just forked the GitHub project and added a simple extension. In short, I just added a new attribute with a method expression, and in that method I return the autocompleted command, if applicable. The value of the input box is replaced in case of completion.
Code: Select all
<p:terminal id="terminal"
commandHandler="#{terminalController.handleCommand}"
autoCompleteHandler="#{terminalController.autoCompleteCommand}" />
P.S.: In my implementation I created a new class which extends the code of org.primefaces.component.terminal.Terminal.java. I did so because Terminal.java is generated. Noob question incoming: am I not able to change the source of that class?