Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Getting started with Eclipse code templates

Move beyond snippets to increase your productivity

Jeremy Wischusen (cortex@visualflowdesigns.com), Flash, Flex, PHP Web Developer, Visual Flow Designs
Jeremy Wischusen has been designing Web sites since 1997 and programming since 2003. He has worked with Microsoft Gold Certified Partners to deliver software training for such companies as Wyeth Pharmaceuticals and The Vanguard Group. He has also worked on large-scale sites, such as myYearbook.com and for such clients as Dockers, Quicksilver, Major League Baseball, Sports Authority, CBS, and Liz Claiborne through GSI Commerce. He works with front- and back-end systems, designing many projects from start to finish using such technologies as Ajax, jQuery, CSS, XHTML, PHP, Flash, and Flex.

Summary:  This tutorial covers the basic use of Eclipse code templates. It takes a broad approach to expose the key concepts and skills that apply to templates regardless of the particular plug-in they're associated with. You will learn about the benefits of templates, how to create and edit them, and how to use them within the Eclipse IDE to increase your productivity.

Date:  07 Oct 2008
Level:  Intermediate PDF:  A4 and Letter (379 KB | 19 pages)Get Adobe® Reader®

Activity:  91714 views
Comments:  

Summary

It should be clear that Eclipse templates are far more versatile than simple snippet functionality. Unlike snippets, Eclipse templates are directly integrated into the workflow in Eclipse — from creating a new document to working in the editor. The ability to use variables in templates makes customization a breeze, whereas with snippets, you basically get a shell you can insert and edit manually.

This tutorial was purposefully broad, and you will have to spend some time learning the templates for each plug-in you end up using. However, most of the differences you will find among plug-ins that support templates have to do with the number of predefined templates, available contexts, and the number of predefined variables. You are already familiar with all these concepts from this tutorial. I used a wide variety of Eclipse plug-ins (HTML, PHP, the Java™ language, Python, and more) that support templates, and the skills you have learned here are applicable to all of them.

When you become accustomed to using templates, you'll wonder how you ever lived without them. On the rare occasions I find myself working in an editor other than Eclipse, I find myself trying to trigger the templates. When I realize that they're not there, I breathe a sigh of frustration.

7 of 9 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=342826
TutorialTitle=Getting started with Eclipse code templates
publish-date=10072008
author1-email=cortex@visualflowdesigns.com
author1-email-cc=