Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Scout/Tutorial/5.0/HelloWorld

< Scout‎ | Tutorial‎ | 5.0
Revision as of 12:29, 29 January 2015 by Mvi.bsi-software.com (Talk | contribs)

The Scout documentation has been moved to https://eclipsescout.github.io/.

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

CreateANewScoutProject.PNG

Start your Eclipse with an empty workspace and Use the File | New | Project ... menu.

CreateANewScoutProject2.PNG

In the wizard choose Scout project and click Next.

CreateANewScoutProject3 5.PNG

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.

CreateANewScoutProject4.PNG

Select Application with a single form as your app template, then click Finish.

CreateANewScoutProject5.PNG

The empty application is created by The Scout documentation has been moved to https://eclipsescout.github.io/. and if you are not already in the The Scout documentation has been moved to https://eclipsescout.github.io/. you are prompted to switch now. Click on Yes.

Run the Empty Scout Application in the Scout SDK

CreateANewScoutProject7Ver4.0.PNG

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.


After starting first the server (1) and then the Swing client (2) from the launching boxes as shown below, the empty client will appear.

CreateANewScoutProject8Ver4.0.PNG

Client Side: Add a Message Field to the Desktop Form

Scout-NewFormField.PNG

In the The Scout documentation has been moved to https://eclipsescout.github.io/. drill down to client, Forms, DesktopForm, MainBox

To the main box we will add a message The Scout documentation has been moved to https://eclipsescout.github.io/.. Click right on MainBox and choose the menu New Form Field.

Scout-NewFormField2.PNG

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)

Scout-NewFormField3.PNG

Step 2: Add the field label, type "Message" that triggers the dropdown list. Choose New translated text... (or use an existing text)

Scout-NewFormField4Ver4.0.PNG

Step 3: Fill in the default translation. Some other fields are automatically filled:

  • Key Name used to retrieve the translated text in the code
  • default The translation for the default language (usually English). More languages and text translations may be added any time (see Scout/Concepts/NLS-Support)

Then click OK

Scout-NewFormField5.PNG

Step 4: Verify details of the new string field by clicking again into the Text: The bold title is the key name and all translations should be shown

Confirm by clicking Finish

Scout-NewFormField6.PNG

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 Services, and DesktopService. The DesktopService is the server side service corresponding to the DesktopForm defined on the client side. This The Scout documentation has been moved to https://eclipsescout.github.io/. was created as part of the selected application template. The load(DesktopFormData) method is defined out of the box.

Scout-HelloworldVer4.0.PNG

Add a simple implementation for the load method:

  1. public DesktopFormData load(DesktopFormData formData) {
  2.   formData.getMessage().setValue("hello world");
  3.   return formData;
  4. }
 (load ... throws ProcessingException, missing in default generation in Version 4.0) 

On line 2 we access the message field of the The Scout documentation has been moved to https://eclipsescout.github.io/. and set its 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"

Scout-Helloworld1.PNG

Back to the top