Just want to have a quick try with IT Mill Toolkit? This section presents a QuickStart into running and debugging IT Mill Toolkit demos under Eclipse. The QuickStart includes a web server, so you do not need to install a full-weight web container such as Apache Tomcat.
The installation directory of IT Mill Toolkit contains all the necessary files to allow importing it as a ready-to-run Eclipse project. Do the following steps.
Start Eclipse. If necessary, switch to Java Perspective from menu
→ → .Select
→ and the dialog for importing opens.In the Import dialog, select → and click .
In the itmill-toolkit-5.x.x
. Click
in the selection window. Click
in the Import
window to finish importing the project.
The newly imported project will look as follows.
You can browse the source code of the demo application, and run the demo in a web browser by following the instructions given in the next section.
Once the project is imported, as described above, you can run the Content Browser, including the demo applications, as follows. Either:
Notice that after the application is launched once, it appears on the Favourites list. You can then either:
Click on the small dropdown arrow on the right side of the
button on Eclipse toolbar and select .or... Select
→ → .Running the application in Web Mode will open a browser window with the Content Browser. The default system web browser is opened; make sure that the browser is compatible with IT Mill Toolkit. The Console view in the lower pane of Eclipse will display text printed to standard output by the application. Clicking on the red button will stop the server.
Notice that executing the web application locally may provide a security warning from your firewall software. This is caused by the Web Service which is started to run the Content Browser. You have to ignore the warnings or temporarily accept connections to port 8888 on your firewall software. Also, if the web service fails to start, make sure that no other service is using port 8888.
The Hosted Mode Browser of Google Web Toolkit is a special web browser that runs the client-side GWT Java code as Java runtime instead of JavaScript, thereby allowing you to debug the client-side components in an IDE such as Eclipse.
http://dev.itmill.com/ticket/1636
.
To run the demo applications in the Hosted Mode Browser of Google Web Toolkit, follow the following steps:
Starting demo applications under the Hosted Mode Browser can take considerable time! This is especially true for the Reservation and Color Picker applications, which require compilation of custom widget sets. During this time, the Hosted Mode Browser is unresponsive and does not update its window. Compiling widgets can take 5-30 seconds, depending on the hardware.
As with the Web Mode launcher, after you have run the launch once, you can select
→ → , or click the dropdown marker on right of the button in the toolbar and select .To use the Hosted Mode Browser in your own projects, you need to create a launch configuration in Eclipse. See Section 8.7.6, “Hosted Mode Browser” for more detailed information about the Hosted Mode Browser and how to create the launch configuration.
To stop the launched Jetty web container that serves the Content Browser web application, select the Console tab and click on the button.
To clean up all terminated launches from the Console window, click on the button.
You can inspect and experiment with the imported project as you like. When you develop an application, you may want to debug it. Running a web application in debug mode is easy in Eclipse. Next, we will show you how to debug the demo applications by inserting a breakpoint in the Calc example.
Select from menu
→ and the Debug configuration window will open.Select
→ and click . The server will start and the web browser will open.Open the Calc application by selecting on the start page
→ .
Open the source code for the Calc program. It is located in
WebContent/WEB-INF/src/com.itmill.toolkit.demo.Calc
. Doubleclick
the class to open the source code in the editor.
Insert a breakpoint in the init()
(line
57) by clicking on the gray bar on the left of the editor window
to open the context menu, and select
.
Switch to the browser window and click on the Calc link to open it.
Eclipse encouters the breakpoint and asks to switch to the Debug perspective. Click
. The debug window will show the current line where the execution stopped as follows:If you like, you can also use the imported Toolkit as a skeleton for your project. Just remove any unnecessary files or files related to the demo applications from the project. You may also want to rename the IT Mill Toolkit installation directory with a name more proper for your project.
If you want to go the long way, which is probably preferred for a real project, especially a large one, you should follow the instructions in Section 1.6, “Your First Project with IT Mill Toolkit”.