Tip:
Highlight text to annotate it
X
Welcome to the Google Plugin for Eclipse screencast.
First we're going to install the Google Plugin for Eclipse.
To do that, go to the plugin download page and copy the URL
onto the clipboard.
We'll use the normal mechanism for
installing plugins in Eclipse.
Help, Install New Software.
Paste in the URL.
And then check the box for the plugins and SDKs.
Then click Next.
Now that the plugin is installed and we've restarted
Eclipse, you'll notice that the Google plugin has
contributed new icons to the toolbar.
So we have the New Project icon, the GWT Compile icon,
Speed Tracer, and Deploy to App Engine.
So we'll create a new web application project.
It's a little greeting application.
It's the standard sample GWT app.
So we'll just call it Greeting.
And we'll create the new project in our workspace, use
Google Web Toolkit and Google App Engine.
And check the box to generate GWT project sample code.
Click Finish.
And this will create our application.
Once the application appears, we want to launch it using GWT
development mode.
To do that, right click, select Run As, Web
Application.
Because this is an App Engine project this will start the
App Engine dev server, as well as the GWT development mode.
And you'll see a tab highlight when the
development mode is ready.
Then you can just right click on the URL and copy it to the
browser, or just double click to launch the development mode
in the browser.
With dev mode running, we can now make changes to our code
and see them reflected in the browser.
Let's change the text on the Send button.
We switch back to Eclipse.
Find the button in the greeting.java sample code.
And let's change it to Hi There.
I click Save.
Then return to the browser and click Refresh, and you can see
that the button now says Hi There, reflecting our changes.
Google Plugin for Eclipse also allows you to use the Eclipse
debugger to step through your GWT code.
To do that, let's stop the running dev mode server by
clicking on the Stop button.
And then right click on the project.
And instead of Run As, we'll say Debug As, Web Application.
This launches the dev mode server the same as before, but
it's integrated with the Eclipse debugger.
Once the Development Mode tab is highlighted, we again click
on the URL and it starts a tab in the browser.
While we're waiting for the dev mode plug-in to start,
let's go back to Eclipse and set a break point in our code.
We'll set it in the onClick handler for the button, so
that we can see it when we click.
Just double click in the gutter bar as usual, and then
go back to the browser and click the button.
When we do that Eclipse stops execution right at the line
where we set, and shows us the debug perspective, where we
can now use the controls to step through our code, inspect
variables, et cetera, just as we normally do in Eclipse.
Now let's look at a new capability in Google Plugin
for Eclipse version 2.3.
I'm going to stop development mode and switch back to the
Java perspective.
And say we wanted to add one of the Google APIs, like the
calendar API, to our project.
We could go up to the toolbar, click Add Google APIs, and
then see a list of available APIs.
We'll choose the calendar API and click Finish.
What this will do is add a new class path container to our
project, which shows the new API.
We see calendar here.
And all the JARs have been brought in
automatically for us.
Now let's say instead of a new project you wanted to import a
project which is already in Google Project Hosting.
To do that we can select a new menu item, Import Google
Hosted Project.
And this will show me a list of projects for my currently
signed-in user.
I want the konos-java project here, which is something I'm
doing for a high school Java class I'm teaching.
Click Next.
And it's automatically going to pull this from the
subversion repository.
I'm going to change the name of the project and Next again.
Use the default workspace and click Finish.
Now it's checking out the project from Subversion.
And it will show up in my workspace.
The new application is also an App Engine app, so let's
deploy it to app engine.
Click on the project, then on the Deploy tool.
And it's now asking us to sign in with our Google account,
which can also be used for other Google
services within Eclipse.
We grant access.
And you'll notice that the user name we're signed in with
now appears in the lower left corner.
We'll select the App Engine Project Settings.
Check the application ID, which we've already created.
Give it in a new version and then click OK, and deploy.
While we're waiting for deployment to finish, we can
look at the current version of the app hosted at
spirodraw.appspot.com.
Note that the buttons are all scrunched together on
the left side here.
We can look at the versions in the admin console, and see
that we're currently serving version 1.
Now that deployment is completed successfully, let's
look at our new version in the admin console.
We note that we have a new version named demo, and we
want to test that version to test our changes.
So we click the version-specific link.
And note that we've fixed the button spacing and added an
I'm Feeling Lucky button.
To make this the live serving version, we go back to the
versions console.
Click the Demo Version radio button.
And then click the Make Default button.
Now when we look at the live serving version at
spirodraw.appspot.com, we can see that we
have the new button.
And our new version is live.
Thanks for watching, and we hope you enjoy Google Plugin
for Eclipse.