The console user interface (ConsoleUI) is a technology for displaying data
in a text-based format on a Windows® or UNIX® screen. This technology
is available only in EGL-generated Java™ programs, not in PageHandlers.
The interface that you create with ConsoleUI can be displayed in Windows 2000/NT/XP
or UNIX X-windows,
either locally or by way of a remote terminal session.
ConsoleUI is distinct from Text user interface (TextUI), and the two cannot
operate in the same program:
- When TextUI is in effect, the style of interace is like that used in a
mainframe program interacting with 3270 terminals. The program presents a
text form but does not process user input as the user moves from one field
to the next. When the user submits the form (by pressing the Enter key,
in most cases), all the data in the form returns to the program, and only
then does the program validate the data; if validation succeeds, the program
runs the next coded statement.
- When ConsoleUI is in effect, the style of interface is like that used
in a UNIX-based program interacting with character-based terminals. The program
presents a console form and can respond immediately to a user event, as when
the user presses the Tab key to move an on-screen cursor to the next
field. Validation is on a field-by-field basis, and you can restrict the cursor
to the current field until the user has typed valid data there.
When you use consoleUI, you typically code a program as follows:
- Declare a set of variables that are based on the ConsoleUI parts, which
are always available; you do not define the parts that are specific to ConsoleUI.
- Open a visual entity such as a form by including a consoleUI variable
as an argument when you invoke the appropriate EGL function. Alternatively,
you can open a visual entity by invoking an EGL function like displayFormByName,
which accepts a name that is known at run time.
- Reference the visual entity in an EGL openUI statement, which allows
for user interaction by tying particular events (such as user keystrokes)
to particular logic.
The user of a consoleUI application can press keys to interact with the
on-screen display, but mouse clicks have no effect.
ConsoleUI can accept user input into a field, but only if you have specified
a
binding, which is a correspondence between the input field and a
variable of primitive type. The EGL runtime acts as follows:
- Uses the variable value as the initial content of a displayed field; and
- Moves the user's input to that variable as soon as the user leaves the
field.
ConsoleUI also allows you to interact with users in
line mode, which
is a mode of processing in which your code reads or writes only one line at
a time. The implications of line mode are as follows:
- In the Eclipse workbench, the user interacts with the Console view
- In a program that was invoked with a command prompt, the user interacts
with the command window
- In a program that runs under Curses in UNIX, the user interacts with the window
in which the UI is displayed; and the usual window-based interaction is suspended
ConsoleUI is equivalent to the user-interface technology in the Informix® 4GL
product.