Product Information > JADE Development Environment User’s Guide > Chapter 3 - Defining Classes in Your Own Schema > Defining Applications

Defining Applications

Within your schema, you can have one or many applications. While each application in a schema can differ in appearance and functionality, it shares the same underlying object model as other applications in that schema; that is, the object model defined by the schema.

The Application class provides a superclass for all user application instances. Each user application is defined as an instance of the Application class. The Application class defines standard properties and methods for the running of any application.

Each time a new schema is defined, an instance of the Application class is created for that schema. When a schema is loaded from a file and there is application data (in the .ddb file), JADE creates an instance of the Application class for each application defined in this file.

The following example shows the Application class node expanded in the Class List of the Class Browser, with the Application Browser and Run Application dialog illustrating the connection between the Application class and the user applications defined in that class.

The Application Browser provides a summary of application attributes, which are displayed in a table that has the following columns.

  1. Default, with an arrow in the row of the default application.

  2. Name, containing the application name.

  3. Application Type, containing the application type.

  4. Startup Form/Document, containing the name of the startup form, if specified.

  5. Application Initialize Method, containing the name of the application initialize method, if defined.

  6. Application Finalize Method, containing the name of the application finalize method, if defined.

  7. Application About Form, containing the About form of the application, if specified.

You can right-click in the table on the Application Browser to display the Application menu commands.

Double-click on the name of:

The LockTest schema shown in this example has user-defined applications, which in the development environment are persistent instances of the Application class. These user-defined applications inherit any constant, property, or method defined in the Application class or that you defined in the LockTest subclass.

View persistent user-defined applications instances by selecting the Classes menu Inspect Instances command or from the Application Browser. View shared transient instances for a node by selecting the Classes menu Inspect Shared Transients command.

To run an application, select the required application in the Run Application dialog. A transient instance of the class is then automatically made available to the run time copy of the application.

To add an application to your current schema

  1. Perform one of the following actions to open an Application Browser window.

    The Application Browser is then displayed.

  2. From the Application menu of the Application Browser, select the Add command.

    The Application sheet of the Define Application dialog, shown in the following diagram, is then displayed, to enable you to specify general application details.

  3. In the Name text box, specify the name of your new application. An entry in this text box is mandatory. The name must start with an uppercase character and it must be unique to the schema to which you are adding it.

  4. In the Help File text box, specify the name and location of the application help file, if required. For example:

    c:\jade\testapp.hlp

    Use the Browse button to search for your help file, if required. When you click the Browse button, the common File dialog is then displayed, to enable you to select the appropriate file or location. The help file can be an Adobe Acrobat Portable Document Format (.pdf) file, a Windows help (.hlp), or a compiled help (.chm) file.

    If you do not specify a help file in this text box or you do not use the Application class helpFile property to dynamically set the help file at run time, no help file is opened when help is requested.

  5. In the Version # text box, specify the application version number, if required.

  6. In the Default Locale combo box, select the default locale (language) for your new application, if required. The locales that are listed are those supported by the current schema. If you do not specify a default locale, the current locale is set to the first locale supported by the schema.

    When the default locale is set in the JADE development environment, the Locale not supported message box is not displayed in the runtime application.

    The default locale is used when the application is run under a locale that is not supported by the schema of the application. The application cannot be run under a locale that is not supported, as no form and string translations will exist. If you try to run an application under a locale that is not supported by the schema, the current locale is set to the application default locale.

  7. Use the Application Type combo box to select the type of application that you require, as follows.

    For more details, see the Application class applicationType property in Chapter 1 of the JADE Encyclopaedia of Classes.

    Applications of type No Forms, Non_GUI, Rest Services, Non‑Gui, and Web‑Enabled Non‑GUI terminate only after the JADE terminate instruction is executed.

    The Application class startApplication and startAppMethod methods start only Non-GUI, Rest Services, Non‑Gui, and Web‑Enabled Non‑GUI applications if they are invoked from a server method or server application. (An exception is raised if they are invoked from a server method or a server application to start an application of a type other than non-GUI.) On a client node, they start all types of application.

  8. If you selected the Web‑enabled or Web‑enabled Non‑GUI application type in the previous step, the Web Application Type group box is then enabled. If you do not want to dynamically generate HTML based on JADE forms, select the:

    By default, HTML is dynamically generated in Web applications based on JADE forms; that is, the JADE Forms option button is selected.

  9. In the Icon group box, click the Change button if you want to display the common File Open dialog, to enable you to select an icon (.ico) file for your JADE application icon display.

  10. In the Start-up Form combo box, select the form that is to be displayed when the new application is started.

    The first form that you create for the application becomes the default start-up form when you run your application. (For details, see "Adding a New Form", in Chapter 5.)

    If your application type is Web‑Enabled or Web‑Enabled Non‑GUI and you do not select or specify a value in this combo box, the HTML Documents sheet on the Web Options sheet is enabled so that you can define an HTML home page.

  11. In the About Form combo box, select the form that is to be displayed in response to a user of the runtime application selecting the About command in the Help menu.

  12. In the Initialize Method combo box, select the start-up method that is to be invoked when the application is started (for example, the initialize method), if required. This must be a method of the Application class.

    The Application class initialize method is called automatically if you do not explicitly specify a start-up method in the Initialize Method combo box.

  13. In the Finalize Method combo box, select the method that is to be invoked when a close request has been made for your application. This must be a method of the Application class. When the selected finalize method is invoked, the application then terminates, and cannot handle new form requests.

  14. Select the Form sheet if you want to specify your form preferences. (For details, see "Specifying Your Form Preferences", in Chapter 5.)

    Alternatively, perform one of the following actions.

Your specified application is then created as an instance of the Application class and is therefore not displayed in the Class List of the Class Browser. It is displayed in the Application Browser, however, and can be viewed from the Class Browser by inspecting instances of the Application class.

Only one Application Browser for the current schema can be open at any time. If an Application Browser is already open for that schema, it is brought to the top when you click the Browse Application toolbar button or you select the Applications command from the Browse menu.

You can have concurrent open Application Browsers for different schemas in the current development environment session.