developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
New
 
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




Vote for the Developer.com Product of the Year Winners!




Developer Jobs

Be a Commerce Partner














 


Related Article -
Java Development with Eclipse
Meet Eclipse
Developer News -
Security Breach Can't Halt Fedora 10's Debut    November 25, 2008
Red Hat Fedora Claims It's the Leader in Linux    November 21, 2008
Dos and Don'ts of SOA Data Access    November 20, 2008
Mandrake Linux Founder Back, Virtually    November 20, 2008
Free Tech Newsletter -

Developing Eclipse Plug-ins
By Peter Nehrer

Go to page: Prev  1  2  3  

Here, you've overridden the getText(Object) method to return the element's (an instance of IViewDescriptor) label as the text to show in the table. To make it more visually appealing, you also overrode the getImage(Object) method to return each view's associated icon image to accompany its label. This, however, is a little more complex. When you study JFace (the viewer framework used here) and SWT (its underlying widget toolkit), you will discover that images (org.eclipse.swt.graphics.Image) are operating system resources that need to be managed by the application. IViewDescriptor, however, only returns an ImageDescriptor rather than the Image itself. An image descriptor may be used to create an Image instance, but this must subsequently be disposed of when no longer in use. For that reason, you track all Image instances that you create in a descriptor-to-image map, and dispose them when the label provider itself is disposed (in other words, no longer needed by the viewer).

To see the final outcome, relaunch the run-time workbench (Ctrl+F11).

Packaging and Distributing Finished Plug-ins

Even though you may be finished with developing and testing your plug-in, you are still left with the task of getting it out of your development environment and into your users' hands. Luckily, Eclipse doesn't leave you to fend for yourself here either. At a minimum, you can use the Export wizard, easily accessible from your plug-in editor's Overview page. This will produce a distributable archive file, containing your plug-in's code and resources. The users can simply extract its contents into their Eclipse installation, and if all its dependencies are satisfied by their environment, Eclipse will discover and activate your plug-in as soon as its functionality is requested.

This kind of distribution and installation is called unmanaged—you leave the user with the responsibility of finding and installing any updates to your plug-in, should you release any in the future. A more structured approach is to group your plug-ins into features. A feature is a set of plug-ins that are installed and managed together. In addition to grouping the plug-ins, features contain information that allows the Eclipse Update Manager to locate any published updates and discover any new related features. Such updates are typically published in a special Web directory called an Update Site. PDE provides wizards and editors to support the development of features as well as update sites.

If you develop entire applications rather than just plug-ins (or features) that need an existing Eclipse-based product to install into, you would use the Product Configuration editor, together with the Eclipse Product export wizard, to package your application as a standalone Eclipse product. However, this is an advanced topic that deserves at least one article of its own.

Conclusion

Eclipse is a great tool and rich-client application platform not only for the free components it provides, but also for the openness of its own implementation. In Eclipse, all functionality is encapsulated in plug-ins, which "plug into" one another using well-defined extension points. Its Plug-in Development Environment provides powerful tools and wizards to help you get started developing your own plug-ins. More importantly, PDE will support your development throughout the entire cycle, including distribution and post-production maintenance.

In this article, you developed a simple visual plug-in to demonstrate the required steps and tools provided by Eclipse. In the next installment, you will take a closer look at the core components and frameworks used to build Eclipse applications.

Resources

  • Eclipse Help (click Help -> Help Contents in the main menu), also available online at http://help.eclipse.org/help31. See the PDE Guide section for information on PDE tools, and the Platform Plug-in Developer Guide for documentation on Eclipse architecture, API, and extension points.
  • Many good books, such as the Java Developer's Guide to Eclipse, Building Commercial-Quality Plug-ins, and Contributing to Eclipse.
  • The example plug-in developed in this article is available here. To import it into your clean, new workspace as a project, click File -> Import; then choose the Existing Projects into Workspace wizard, and specify the path to your downloaded archive file.

Go to page: Prev  1  2  3  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Languages & Tools Archives






internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers