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 developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

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]

Building Eclipse plug-ins using templates

Christopher Judd (cjudd@juddsolutions.com), Freelance Writer, Judd Solutions, LLC
Christopher Judd is the president and primary consultant for Judd Solutions, LLC, international speaker, open source evangelist, Central Ohio Java Users Group coordinator, and co-author of Enterprise Java Development on a Budget and Pro Eclipse JST. He has spent eight years developing software in the insurance, retail, government, manufacturing, service, and transportation industries. His current focus is consulting, mentoring, and training with Java, J2EE, J2ME, Web services and related technologies.

Summary:  You may know that Eclipse is a framework meant for building other tools. You may also know that you can build your own plug-ins for Eclipse. But did you know that Eclipse comes with seven plug-in templates to get you started? This tutorial gives you a start-to-finish look at building a plug-in using the Hello World template, then introduces you to the other templates.

Date:  28 Jun 2005
Level:  Intermediate PDF:  A4 and Letter (1317 KB | 74 pages)Get Adobe® Reader®

Activity:  11494 views
Comments:  

Start here

Should I take this tutorial?

In this tutorial, you will learn how to build, package, and deploy different types of Eclipse plug-ins using the seven plug-in templates provided with Eclipse. Using these templates helps you by generating many of the necessary plug-in files and configurations, and will reduce your learning curve by providing simple, customized working examples.


What is this tutorial about?

This tutorial introduces you to Eclipse plug-in development. It walks you through the process of developing, packaging, and deploying a plug-in developed from the seven built-in plug-in templates. It discusses in detail each of the following plug-in templates to give you a broad understanding of the types of options available:

  • Hello World
  • Popup Menu
  • Property Page
  • View
  • Perspective Extension
  • Editor
  • Multi-page Editor

You can begin writing Eclipse plug-ins by hand from scratch. However, using the templates can help you:

  • Set up basic plug-in project structure
  • Reduce coding
  • Reduce your learning curve

Plug-in projects have a specific structure. Using the Plug-in Project wizard and templates helps to set up the required structure. In addition, it generates many of the necessary files and configurations. This project structure requires a plugin.xml file at the root of the project. Consider this file as a deployment descriptor for an Eclipse plug-in. It contains information about the plug-in's classpath, other plug-ins it depends on and which extension points the plug-in integrates into. In addition, the project must contain a class that extends org.eclipse.ui.plugin.AbstractUIPlugin. This class will be described in further detail later in this tutorial. And as with all Java™ technology projects, it must contain a source folder and output folder.

Using templates can significantly reduce the amount of typing. They generate many of the classes you need to get started and provide a simple implementation, usually a message dialog, to show you what an implementation might look like. The plug-in templates also update the plugin.xml file to include extension-points and required libraries.

The Eclipse platform itself has more than 1,900 classes and interfaces. Add the JDT, PDE, and J2SE and there is a lot to learn. The plug-in templates can reduce the learning curve and anxiety by providing simple, customized working examples in a few minutes.


Prerequisites

To gain the most from this tutorial, you should have a good working knowledge of Eclipse. Before you start, make sure you have Eclipse downloaded and installed: Eclipse SDK V3.0.2.

Basic knowledge of Java is also helpful.

1 of 13 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=133436
TutorialTitle=Building Eclipse plug-ins using templates
publish-date=06282005
author1-email=cjudd@juddsolutions.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.