Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Scout/Tutorial/3.7/HelloWorld
The Scout documentation has been moved to https://eclipsescout.github.io/.
Contents
The Scout "Hello World" Application
This page shows how to create your Hello World app using the The Scout documentation has been moved to https://eclipsescout.github.io/.. We assume that you already have The Scout documentation has been moved to https://eclipsescout.github.io/..
Create a new Scout Project
Start your Eclipse and Use the New|Project ... menu
In the wizard choose Scout project and click Next
Enter org.eclipse.scout.helloworld as an application name. The last part of the name (after the last period) will automatically be used as the project alias. Then, click Next
Select Application with a single form as your app template, then click Finish
The empty application is created by The Scout documentation has been moved to https://eclipsescout.github.io/. and you are prompted to change to the The Scout documentation has been moved to https://eclipsescout.github.io/.. Click on Yes
Make sure you have switched on the automatic The Scout documentation has been moved to https://eclipsescout.github.io/. update in menu Scout|Update Formdata Automatically
Run the Empty Scout Application in the Scout SDK
In the The Scout documentation has been moved to https://eclipsescout.github.io/. open the node Scout Projects, then click on org.eclipse.scout.helloworld. This will show the Scout Object Properties for the application where you click on the edit icon of the product launcher.
In the product launcher you then select the shortcuts to the launching boxes that you will need most during application development. Typically this contains:
- The Scout documentation has been moved to https://eclipsescout.github.io/. in dev mode (e.g. helloworld-server-dev.product)
- One or more The Scout documentation has been moved to https://eclipsescout.github.io/. in dev mode (e.g. helloworld-swt-client-dev.product for the SWT client)
After starting first the server and then the client from the launching boxes configured in the last step the empty client will appear.
Client Side: Add a Message Field to the Desktop Form
In the The Scout documentation has been moved to https://eclipsescout.github.io/. drill down to client, Forms, DesktopForm, MainBox
- client client part of Scout application
- Forms holding all The Scout documentation has been moved to https://eclipsescout.github.io/. available in the client part
- DesktopForm the form created by the template chosen above: Application with a single form
- MainBox the container holding all UI componens of the form
To the main box we will add a message The Scout documentation has been moved to https://eclipsescout.github.io/.
Step 1: Select field type. Here we'll use a The Scout documentation has been moved to https://eclipsescout.github.io/.. Then click Next (you may directly click on it or use the search box as shown above)
Step 2: Add the field label, type "Message" that triggers the dropdown list. Choose New translated text... (or use an existing text)
Step 3: Fill in the default translation. Some other fields are automatically filled:
- Key Name used to retrieve the translated text in the code
- Deutsch German translation ...
Then click OK
Step 3: Verify details of the new string field:
- Key Name used to retrieve the translated text in the code
- Deutsch German translation ...
Confirm by clicking OK
Navigate down from the MainBox to the newly created MessageField. Double click on the MessageField node to display the generated code (selected code in screenshot above) in the Java editor window.
Server Side: Implement the Data Loading
In the The Scout documentation has been moved to https://eclipsescout.github.io/. navigate to the server node, then Process Services, and DesktopFormService. The DesktopFormService is the server side service corresponding to the DesktopForm defined on the client side. This service was created as part of the selected application template. The load(DesktopFormData) method is defined out of the box.
Add a simple implentation for the load method:
public DesktopFormData load(DesktopFormData formData) throws ProcessingException {
formData.getMessage().setValue("hello world");
return formData;
}
On line 2 we access the message field of the formdata and set it's value to "hello world"
. The updated form data is returned and eventually sent back to the client.
Run the "hello world" application
In the The Scout documentation has been moved to https://eclipsescout.github.io/. go back to top-level node Scout Projects, then click on org.eclipse.scout.helloworld to access the launch boxes in the Scout Object Properties.
- Start the server in the server box
- Start the client in the SWT box
And, "Ta Taa"