Eclipse Ganymede For the Web

No Comments

Ganymede for the Web

The Eclipse project released Ganymede and is it impressive!

In just a few moments, Ganymede was up and running Web Editing tools with previews from it's built in web browser, importing my old C projects, checking out subversion repos and running faster than I remember Europa ever moving.

Although I've never really used Eclipse to develop for the web (I have a thing for Bluefish, I thought it would be interesting to give it a test drive.

You'll need the web tools plugin if you're like me and generally only download the Eclipse CDT. Europa users will notice they've changed the plugin management and installation system for the better.

 
Click Help -> Software Updates
Click the "available software" tab.
Expand Ganymede.
Expand "Web and Java EE Development"
Select "Web Developer Tools" and "Web Page Editor"
When finished, open your new "Web Perspective" by clicking the "New Perspective" icon at the top right -- or file -> new your way to a new webpage. Once opened, you'll find a new icon at the top toolbar of a little world... That's the built-in web browser. To set it up for a preview (like the screenshot above) just "tear off" the tab, drag and drop it to the lower half of the code editor window. Now you've got a classy Eclipse with a preview to do your web work in. Autocomplete is triggered with ctrl-space.

But wait........... We're missing something!
Where's tidy?

Tidy is an HTML parser that helps you to keep your code compliant and standard. When working in Linux, I often "wget" and "tidy" my html output to make sure I'm writing clean code. Having to launch a shell and "tidy" my code is pretty annoying.....

Not a problem in Ganymede. Of course, you'll need tidy for Linux or Windows.

After downloading, head to "Run -> External Tools -> External Tools Configuration."
Once opened, click "program" and the "new" icon.
 
Name: Tidy
Main: /usr/bin/tidy (or your path to tidy -- don't forget .exe for Windows)
Working Directory: (blank is fine)
Arguments: -errors -quiet ${resource_loc}

Click Run when ready. You may receive an error about ${resource_loc} being empty. Disregard it. This happens when the command is run without a window being selected first.

When finished, open an HTML file in Eclipse. Make sure the editor window is selected, and click Run -> External Tools -> Tidy

You now have a console output for Tidy warnings.

The best part?

Copy the whole thing to a thumbdrive and carry your new all-in-one development environment in your pocket.

Be the first to write a comment!