Starting to work with EGL Rich UI
This topic tells how to start developing applications with EGL Rich UI.
Enabling the Rich UI capability
If you are
working in an existing workspace, enable the Rich UI capability:
- Click Window > Preferences. The Preferences dialog box is displayed.
- Expand General and click Capabilities. The Capabilities page is displayed.
- Click Advanced. The Advanced Capabilities dialog is displayed.
- Click EGL Rich UI and click OK.
- Click Apply to save your changes and remain on the Preferences dialog box. Alternatively, click OK to save the changes and exit the page; or click Cancel to cancel the changes and exit the dialog box.
Setting the Rich UI editor as the default for EGL files
If you create a new project, EGL automatically selects
the correct editor for the type of file you open. This means a Rich
UI handler opens in the EGL Rich UI editor. However, if you import
a project into your workspace, EGL opens all .egl files with the standard
EGL source editor. You can force EGL to always use the EGL Rich UI
editor for files with the .egl extension:
- Click Window > Preferences. The Preferences dialog box is displayed.
- Expand General and Editors and click File Associations. The File Associations dialog is displayed.
- In the File types section, click .egl
- In the Associated editors section, click EGL Rich UI Editor and, at the right, click Default
- Click OK
Accessing the Rich UI samples
Use the Rich
UI samples to explore the technology:
- Click Help -> Samples. The Help dialog box is displayed.
- Expand Samples, Technology samples.
- Click Rich UI technical sample.
- If your workbench does not already have the com.ibm.egl.rui project, click the entry to it.
- Click the entry to import the samples.
- In the workbench Project Explorer, expand the project com.ibm.egl.rui.samples, file EGL Source, package contents.
- If you previously set the Rich UI editor to be the default for EGL files, double-click contents.egl. Otherwise, right-click contents.egl and select .
- Select the Preview tab at the bottom of the editor.
- Follow the on-screen directions and try out the alternatives presented there.
Creating your first Rich UI project
When
you want to work outside of the Rich UI samples project, do as follows:
- Click File -> New -> Project. The New Project wizard is displayed.
- Expand EGL, click EGL Project and then Next. The New EGL Project page is displayed.
- Type a project name and select Rich UI Project.
In most cases, complete the task by clicking Finish,
However, if you want to consider additional options, continue here:
- Click Next so that the EGL Project page is displayed.
- To include the project in the directory that stores the current workspace, select the check box for Use the default location for the project; otherwise, specify a different directory by clearing the check box and using the Browse mechanism.
- An EGL deployment descriptor lets your application access remote services in a flexible way, so that at configuration time, an installer can change the details of service access. The overhead of including the descriptor is small, and we recommend that you select the check box for Create an EGL deployment descriptor regardless of your intent. Click Next. The EGL Settings page is displayed.
- The Projects tab lists all other projects in your workspace. Click the check box beside each project that you want to add to the project's EGL build path.
- To put the projects in a different order or to export any of them, click the Order and Export tab and do as follows: (i) To change the position of a project in the build-path order, select the project and click the Up and Down buttons; (ii) to export a project, select the related check box; and (iii) to handle all the projects at once, click the Select All or Deselect All button.
- Click Finish.
Reviewing general information on EGL
The
EGL Cafe is a center of information about the products that include
EGL:
For
a concise introduction to EGL, see Enterprise Web 2.0 with EGL:
See the
following topics in the EGL Programmer's Guide (aside from
topics specifically on Rich UI):
- Using EGL with the Eclipse IDE
- Introduction to EGL projects through Properties:
- In relation to Data parts, ignore references to Form Group and ArrayDictionary
- In relation to Logic parts, ignore references to Handlers (other than Rich UI handlers) and Programs
- Ignore Build parts other than the build descriptor and the deployment descriptor
- Content assist
- Searching for EGL files and parts
- Setting Preferences in the EGL editor; specifically, the
following topics:
- Setting Preferences for folding in the EGL editor
- Setting Preferences for organizing import statements in the EGL editor
- Setting Preferences for source styles
- Enabling and disabling code templates
- EGL debugger commands
- Setting preferences for the EGL debugger
Exclude the following subjects when reviewing
the EGL Language Reference:
- File and database access; related statements such as forEach and get, and related Exception records. When you work with Rich UI, all such access is handled by invoked services.
- The Program-related statements transfer and call.
- User interfaces.
- Record stereotypes other than BasicRecord and ExceptionRecord.
- Details that are specific to Java™ or COBOL processing; in particular, details related to J2EE, CICS®, IMS™, and z/OS® batch.
- Compatibility with VisualAge® Generator or Informix® 4GL.
- System libraries ConsoleLib, ConverseLib, DliLib, J2eeLib, JavaLib, LobLib, PortalLib SqlLib, VgLib, and VgVar.
See the following topics in the EGL Generation Guide (aside
from topics specifically on Rich UI):
- Introduction to EGL generation
- Build descriptor part
Reviewing compatibility issues
Here are the major compatibility issues:
- File, database, and printer access is supported only by service access, not directly by the Rich UI application code. However, Rich UI supports non-structured Record parts, stereotype SQLRecord (as well as stereotypes BasicRecord and ExceptionRecord). Not supported are the Record part properties containerContextDependent, i4glItemsNullable, and textLiteralDefaultIsString.
- Reporting is not directly supported.
- Function overloading is not supported
- Generation of the following outputs is not supported: programs, forms, form groups, data tables, services, or other outputs that are specific to Java™ or COBOL.
- A version of the call statement is supported, but only to invoke services.
- Only the following variations of the exit statement are supported: exit for, exit if, exit while, and exit case.
- The following statements are not supported: add, close, converse, continue, delete, display, execute, forEach, forward, get, freeSQL, goTo, move, open, openUI, prepare, print. replace, set, and transfer.
- The following types are supported: ANY, BIGINT, BIN (but only in the absence of decimal places), Boolean, DataItem, DATE, DECIMAL, Delegate, Dictionary, FLOAT, INT, NUM, NUMBER, SMALLFLOAT, SMALLINT, STRING (but only in the absence of a size limit) , TIME, TIMESTAMP, NUM, MONEY, Service parts, Interface parts, External types (stereotype JavaScript™), arrays of supported types, and non-structured Basic, Exception, and SQL Record parts.
- The following types are not supported: ArrayDictionary, BIN (with decimal places), BLOB, CHAR, CLOB, DataTable, DBCHAR, HEX, INTERVAL, MBCHAR, NUMC, STRING (with a size limit), PACF, UNICODE, structured Record parts, and parts specific to the technologies Console UI, reports, Text UI, and web transactions.
- The following system libraries are not supported: ConsoleLib, ConverseLib, DliLib, DliVar, J2eeLib, JavaLib, LobLib, PortalLib ReportLib, SqlLib, VgLib, and VgVar.
- The following dateTimeLib functions are not supported: intervalValue() and intervalValueWithPattern().
- The mathLib function assign() is not supported. Also, the data-type restrictions noted earlier limit the support for the following mathLib functions: abs, max, min, precision, and round.
- The StrLib constant nullFill is not supported.
- The following strLib functions are not supported: byteLen(), charAsInt(), defaultMoneyForm(), defaultNumericFormat(), formatNumber(), getNextToken(), getTokenCount(), intAsChar(), intAsUnicode(), setBlankTerminator(), setNullTerminator(), unicodeAsInt(). Also, the data-type restrictions noted earlier limit the support for the following mathLib functions: getNextToken() and indexOf().
- The only supported sysLib functions are conditionAsInt(), writeStdError(), and writeStdOut().
- The only supported sysVar variable is sysVar.systemType.
- Literals of type CHAR, DBCHAR, and MBCHAR are not supported.
- The three bitwise operators (& | Xor) are not supported; nor is the in operator.
- Only the following variations of the is and not operators are supported: use of sysVar.systemType and record-specific tests of blanks and numeric.
- Rich UI code cannot compare a variable of type ANY to a value
variable:
// Not supported if (myAny == 1) ; end - The details on using the EGL debugger are slightly different, as described in Rich UI debugging.
- Throughout EGL, a property can reference a variable (
theProperty = theVariable), even if the variable is declared in code that is subsequent to the reference. Rich UI works the same way, with the following exception: a widget of type Widget (a generic type that is used for advanced purposes) must be declared before the widget is referenced. - A widget is an EGL reference variable. When declaring a widget
statically (without the new operator), remember
to specify a set-values block ({}), as in the following example:
myButton Button{};