Console
A command-line interface (CLI) for creating all kinds of text consoles for Vaadin applications.
Because sometimes a text based interface is more easier to use than a GUI.
With Console you can add a command line interfaces to your web application. Use it for SQL query interface, admin shell, test interface, build integration, etc.
- Supports raw line-based input, predefined commands, and basic control characters.
- Built-in argument parsing. Supports grouping with double quotes.
- Simple command/callback mechanism to quickly add new console commands
- Command history
- Terminal-like scrollable buffer
- Following control characters are supported: BELL (^G), TAB (^I), LINE_FEED (^J) , FORM_FEED (^L), CARRIAGE_RETURN (^M).
- Bash-like command completion using TAB
- Bash-like "visual bell"
- PrintStream implementation for redirecting output to console (even System.out or System.err).
- Custom command prompt and greeting message
- Set size either using width/height or rows/columns
- 'ObjectInspector' helper to expose properties and methods in any Java object to the Console as commands.
Note: Since version 1.1.6 the Console add-on requires Widget RPC add-on.
Sample code
// Create a console final Console console = new Console(); // Handler for the console root.addComponent(console); // Size, greeting and other configuration console.setPs("}> "); console.setCols(68); console.setRows(20); console.setMaxBufferSize(20); console.setGreeting("Welcome to Vaadin console demo."); console.reset(); console.focus();
.term, .term .i { background-color: #F5F5F5 !important; color: #222222 !important; }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Refactored the client-server communication to use the Widget RPC Add-on.
- Released
- 2011-02-20
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.3+
- Browser
- Internet Explorer
- Internet Explorer
- Firefox
- Safari
- Google Chrome