Getting started with Rialto GWT

Here you will learn how to create a simple HelloWorld application using Rialto GWT.

The first step you have to do is downloading the lastest version of the Google Web Toolkit and creating a new gwt project. (If you are not familiar with GWT, please take a look at the GWT Tutorial)

Create a module called HelloWorld in the package fr.improve.rialto.gwt.sample.gettingStarted

Then, your HelloWorld.gwt.xml file must be like that:

1<module>
2  <!-- Inherit the core Web Toolkit stuff. -->
3  <inherits name="com.google.gwt.user.User"/>
4
5  <!-- Specify the app entry point class. -->
6  <entry-point class="fr.improve.rialto.gwt.sample.client.HelloWorld"/>
7
8</module>

And your HelloWorld.html file like that:

 1<html>
 2  <head>
 3    <title>Rialto-GWT HelloWorld Appli</title>
 4    <style>
 5      body,td,a,div,.p{font-family:arial,sans-serif}
 6      div,td{color:#000000}
 7      a:link,.w,.w a:link{color:#0000cc}
 8      a:visited{color:#551a8b}
 9      a:active{color:#ff0000}
10    </style>
11    <script language='javascript' src='fr.improve.rialto.gwt.sample.gettingStarted.HelloWorld.nocache.js'></script>
12  </head>
13
14  <body>
15    <!-- OPTIONAL: include this if you want history support -->
16    <iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
17  </body>
18</html>

In the next step, you will add and configure the Rialto-GWT stuffs :
Download the lastest version of Rialto, extract the archive and copy the rialtoEngine folder in the public folder of your project.

Then, download the Rialto GWT jar and put a reference to this archive in the build path.

Now, include the Rialto GWT tools on your project.
To do so open your HelloWorld.gwt.xml file and copy these lines :

1<!-- Inherit the Rialto-GWT core.                   -->
2  <inherits name="fr.improve.rialto.gwt.core.Rialto"/>

For the third (and last) step, you will create your first Rialto GWT page. Open the HelloWorld.java file and add these lines:

 1package fr.improve.rialto.gwt.sample.gettingStarted.client;
 2
 3import com.google.gwt.core.client.EntryPoint;
 4
 5import fr.improve.rialto.gwt.core.client.ui.basic.Label;
 6import fr.improve.rialto.gwt.core.client.ui.panel.RialtoRootPanel;
 7import fr.improve.rialto.gwt.core.client.ui.panel.SimpleWindow;
 8
 9public class HelloWorld implements EntryPoint {
10
11  public void onModuleLoad() {
12    SimpleWindow simpleWindow = new SimpleWindow("My First Rialto-GWT Frame");
13    simpleWindow.add(new Label("Hello World !"));
14    RialtoRootPanel.get().add(simpleWindow);
15  }
16
17}

Now you can run your application.

For more sample code, please see the Rialto GWT Demo