Console UI modes

EGL supports three modes in which you can run Console UI applications: Swing, Curses, and rich client platform (RCP). The three modes have different abilities, but in general a Console UI application behaves the same way in each mode.

Swing mode

Swing mode is the default mode for Console UI applications. If you write a Console UI program, generate it, and run the generated Java™ source without making any other changes, the resulting program runs in Swing mode. A Console UI application running in Swing mode uses Java Swing libraries to simulate a UNIX interface like that of Curses mode.

Curses mode

Curses mode is similar to Swing mode, but Curses mode is intended for users who use telnet to access a UNIX system or who use a terminal device.

To use Curses mode you must add the EGL Curses library to your project and then run the application in the same way as you would run it in Swing mode. After you have added the EGL Curses library to your project, Curses mode becomes the default mode for running Console UI applications. If you run the generated Java output from a Console UI program, that program runs in Curses mode.

For information on how to install the EGL Curses library, see Installing the EGL runtime code for Java.

RCP mode

Rich client platform (RCP) mode is similar to Swing mode, except that in RCP mode, EGL applications use SWT libraries instead of Swing libraries. The resulting application has graphical user interface fields (like fields in a web page form or in a wizard in the Eclipse workbench) in place of the character-based fields. Also, RCP applications have mouse functionality and enhanced keyboard functionality, enabling you to copy and paste text between fields. Finally, RCP mode supports enhanced UI components, or widgets, that the other modes do not, such as drop-down boxes, check boxes, and clickable buttons.

The other modes do not support these widgets, which means that you can run an application designed for another mode in RCP mode, but you can generally not run an application designed for RCP mode in another mode.

A Console UI program behaves similarly in RCP mode as in Swing or Curses mode. The main difference is that you can use the mouse and enhanced keyboard features of the workbench in a RCP program. However, because these features are now enabled, the user might be able to make the program behave differently in RCP mode:
  • Because the mouse is enabled in RCP mode, the user can skip between fields in any order, where in the other modes the user must move between fields in a specific order.
  • Because copying and pasting text is enabled in RCP mode, keyboard combinations like Ctrl+X might behave differently in RCP mode.

Formatting masks are not supported in RCP mode.


Feedback