Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java CLI UI-design: frameworks or libraries? [closed]

Tags:

I'm currently working on a small utility program that only requires a command line interface, and I started wondering if Java provided any standard way of creating the CLI, in a similar way that Swing and the likes exist for GUIs. I'm not really interested in command line parameters and parsing of them, but rather the command based interaction the user has with the program to use it. This is for the situations where GUI simply is unnecessary or not an option for using the program.

Googling the subject pretty much only results in tutorials on how to use BufferedReader and the likes to do rudimentary interaction with the user, aimed at people learning the basics of Java and writing simple UI that asks for name and prints "Hello World!" etc..

Are the any libraries that are focused on providing a good framework for quickly implementing a more complex CLI UI or is this really something that everyone implements in ad hoc manner for their own utilities?

Maybe someone knows of patterns for the implementation that were created back in time when not everything was graphical? That would also be useful resource.

like image 464
Fuu Avatar asked Mar 10 '10 14:03

Fuu


People also ask

What is CLI in Java?

The open source Java Command-Line Interface (CLI) allows users to manage files in BlackPearl using a simple command-line interface. It can be downloaded from the Java CLI page on GitHub.

What UI are used with Java?

GUI (Graphical User Interface) in Java is an easy-to-use visual experience builder for Java applications. It is mainly made of graphical components like buttons, labels, windows, etc. through which the user can interact with an application. GUI plays an important role to build easy interfaces for Java applications.

What is a UI framework?

The UI Framework is the set of classes and interfaces that define the elements and behavior of a window-based UI Subsystem. It defines a structure for defining user interfaces.


2 Answers

Perhaps CLI Toolkit...

http://alexis.royer.free.fr/CLI/

like image 53
John Avatar answered Oct 02 '22 12:10

John


You can also have a look and Clamshell-cli or spring shell:

  • Clamshell-cli is relatively simple and easy to use : You can look at jmx-cli to get a nice example of what can be done with it.

  • Spring Shell is bigger but more feature-full (tab completion, etc). It has been extracted from spring Roo and released as an independent framework

like image 27
Pierre Rust Avatar answered Oct 02 '22 11:10

Pierre Rust