Skip to main content

Create a New Enactor Desktop Application with React UI

Overview

This tutorial will guide you how to create a React Hello World Application using the Enactor Application Wizard.

What you will learn

  1. How to create a React Application with Enactor Application Wizard.

  2. How to run the React Application.

Pre-requisites

An Eclipse Installation with Enactor Tools Plugin

Exercises

Launch Eclipse Application

Launch Eclipse and When prompted for a Workspace enter C:\HelloWorldApplicationTraining

HelloWorldApplicationTrainingWorkSpace

Installing the Enactor Tools Licence

The Enactor Tools Licence is applied to an individual workspace in Eclipse.

To Install the Enactor Tools Licence, Open the Licence Information window by selecting Help Menu → Licence information...

Click Install New Licence...button

Install New Licence

Select your Enactor Tools Licence

Once selected, click OK...button

Eclipse Maven Settings

To use the Maven Dependency manager with Enactor you will first need to set up Maven.

Create a new Maven respository directory named .m2 within you user account directory C:\Users\<USER_NAME>\.m2

Create M2 Directory

From your OS file system, copy the checkout setting.xml file found within /WorkspaceSetup/Config/maven to the newly created .m2 directory.

Checked Out Settings XML

Edit the settings.xml file and replace the following placeholders USER_NAME and PASSWORD with your Enactor Active Directory Credentials

Edit Settings XML

Open the Eclipse Preferences menu and enter Maven in the search bar.

Select the Maven → User Settings

Open Maven Preferences

Confirm that your settings.xml appears in the User Settings Field and that the local Repository Field is also populated

Confirm Maven Settings

Eclipse JRE Settings

Open the Eclipse Preferences menu

Select Java → Installed JREs

Select Installed JREs

Click Add...button

Select Standard VM for the installed JRE Type

Click Next...button

Select JRE Type

Update the JRE home text box by browsing / entering the location of the JDK home directory

Update the JRE name text box by entering default_jre

Click Finish...button

Set JRE as Default

Check the default_jre to make it the default JRE eclipse should use

Use As Default JRE

Click Apply and Close

Generate React Application

Go to File -> New -> Other -> Enactor Development -> Enactor Application and Click Next to Launch the Wizard.

SelectAWizard.

In the Application settings Page fill Application Name as TrainingReactApplication.

Under JRE Select Use a project specific JRE and Select default_jre.

Untick Create module-info.java file.

InitialPage

Click Next and navigate to Version Configuration page and Select the Enactor Platform Version 26-Q1 build 19

VersionConfigPage

Click Next to go to the Maven Configuration page. Here, default values for Group ID, Artifact ID, and Version are provided. You can leave these defaults as they are, or modify them if you prefer a different group or artifact ID.

MavenConfigPage

Click Next to go to the Prompt Type Configuration page. The React prompt type is selected by default. Leave the default configuration as it is.

PromptTypeConfig

Click Finish to generate the Application.

Build the React Application

To run the generated Application, first build the project via Run Configuration → Maven Build → Maven install (TrainingReactApplication) and click Run.

Maven Build

After build is completed, right click on the TrainingReactApplication project and click Maven -> Update Project.

Maven Update

Run the React Application

Since Node is installed on your machine, the application will automatically run in Live Deployment Mode. To use this mode, the React content should be served using the Node Development Server.

Navigate to src-js -> packages -> trainingreactapplication . right click, Enactor -> Run Node Dev Sever option.

Dev Server Option

Click OK.

Dev Server Pop up

This will launch a Node Dev Server

Terminal View

Go to the Run -> Run Configuration -> Java Application and select TrainingReactApplication and Click Run

Java Launcher

The Application will launch as shown. Enter your name in the text box and click Say Hello to display the greeting message.

ReactApplication

note

If Node is not installed on your machine, the application will run in Prebuilt Deployment Mode, and there is no need to launch the Node Development Server.

Further Reading

Refer Enactor Application Wizard