Feeds

Googled by GWT - Part 1

Yes, Ermintrude, there is an alternative to AJAX...

3 Big data security analytics techniques

Setting up an Eclipse GWT project

GWT comes with a command line utility called applicationCreator. This handy little tool automatically generates all the files you'll need in order to start a GWT based Eclipse project. This is done by specify –eclipse and the name of your project, for example:


c:\javalibs\gwt-windows-1.0.21>projectCreator -eclipse HelloWorld

Created directory c:\javalibs\gwt-windows-1.0.21\src

Created file c:\javalibs\gwt-windows-1.0.21\.project

Created file c:\javalibs\gwt-windows-1.0.21\.classpath

Once you have done that you can use the applicationCreator tool to construct the basic structure of your application for you. For example:


c:\javalibs\gwt-windows-1.0.21>applicationCreator -eclipse HelloWorld com.regdev

.client.HelloWorldApplication

Created directory c:\javalibs\gwt-windows-1.0.21\src\com\regdev

Created directory c:\javalibs\gwt-windows-1.0.21\src\com\regdev\client

Created directory c:\javalibs\gwt-windows-1.0.21\src\com\regdev\public

Created file c:\javalibs\gwt-windows-1.0.21\src\com\regdev\HelloWorldApplication.gwt.xml

Created file c:\javalibs\gwt-windows-1.0.21\src\com\regdev\public\HelloWorldApplication.html

Created file c:\javalibs\gwt-windows-1.0.21\src\com\regdev\client\HelloWorldApplication.java

Created file c:\javalibs\gwt-windows-1.0.21\HelloWorldApplication.launch

Created file c:\javalibs\gwt-windows-1.0.21\HelloWorldApplication-shell.cmd

Created file c:\javalibs\gwt-windows-1.0.21\HelloWorldApplication-compile.cmd

Note the use of the –eclipse option in the applicationCreator command above. This ensures the tool creates the correct structure for Eclipse. If you do not include –eclipse then the structure created is essentially the same but without the Eclipse specific elements. For example, instead of a HelloWorldApplication.launch file you will get some scripts such as a script called MyApplication-shell and a compilation script called MyApplication-compile that will allow you to compile and run your GWT application etc.

There is actually guidance provided by Google on the best structure for a GWT project. This is useful information, as some elements of a GWT project may not be where you expect them to be.

Once you have done that, you can import your new GWT project into Eclipse. In my version of Eclipse, I did this by creating a new project from an existing resource (as illustrated in Figure 1).

Screenshot illustrating creating the new Java project (Figure 1).

The end result is that I now have an Eclipse project containing the skeleton of a GWT project with some sample code that I can now edit. This is illustrated in Figure 2.

Screenshot illustrating the skeleton GWT project (Figure 2).

Indeed, so much has been done for you that you can now run this application as it stands from within Eclipse. I did this by selecting the green Run option and then selecting the HelloWorldApplication configuration under the Java Application node in the right hand tree. This ran immediately starting the GWT project in hosted mode. The result was that the screen in Figure 3 was displayed.

Screen shot showing Hello World application displayed (Figure 3).

One really nice feature of this was that it was trivial to use the Eclipse debugger to place break points within your code to test out various logical or functional elements.

Remember that in Hosted Mode your application runs in a pure Java environment that makes Java oriented debugging straight-forward and provides a very Swing like feel to the whole development experience. Web mode on the other hand represents the way in which the deployed application will run – that is as AJAX hosted on an appropriate server. As some issues may be introduced in this compilation, merely testing within the Host environment is, I think, not sufficient to be sure that there will be no problems in the web mode version of the application.

Dissecting A GWT application – the next article

In the next part of this column, we will look in detail at the simple GWT application built above. ®

Top three mobile application threats

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.