Skip to main content


developerWorks  >  Open source | Java technology  >

Simplify Eclipse classpaths using classpath containers

developerWorks

Level: Intermediate

Aaron Tarter (aarontar@us.ibm.com), Advisory Software Engineer, IBM

08 May 2007

Register now or sign in using your IBM ID and password.

Eclipse classpath containers are an organized, user-friendly way to manage Java™ libraries in Eclipse. Since a group of libraries can be referenced as one abstract name, they can be removed and added as a single entry easily. The view of the libraries is also simplified in the Java Perspective as a single entry that can be expanded to view the entire set. Since the set of libraries is defined by an implementation of IClasspathContainer, it can be redefined dynamically. This tutorial shows how to implement a custom IClasspathContainer with accompanying extensions of classpathContainerInitializer and classpathContainerPage.

In this tutorial

This tutorial focuses on Eclipse classpath container functionality. It starts by explaining some Eclipse classpath concepts, then guides you through the details of implementing a classpath container. You will create a simple Eclipse plug-in that provides an implementation of IClasspathContainer, and extends the classpathContainerIntializer and classpathContainerPage extension points to make the container accessible to the user. You will also implement a Java element filter to filter files included in the classpath container from the Java Package Explorer.

In this tutorial, you will learn:

  • The basic concepts behind the Eclipse JDT classpath

  • How to implement IClasspathContainer

  • How to extend classpathContainerInitializer

  • How to extend classpathContainerPage

  • A method for filtering contained classpath entries from the Java Package Explorer, so they are not unintentionally added as duplicates

Prerequisites

This tutorial is written for Eclipse programmers whose skills and experience are at an intermediate level. It is expected that you understand the Eclipse Platform architecture, the basics of extending the platform, as well as Eclipse Java projects and how the classpath is used in those types of projects. The code uses some features that were new to Java 5, such as Generics. The usage is small, but it will help to have an understanding of Java 5 features.


System requirements

To run the examples, you need:

  1. Eclipse V3.2 or later Although you may have some success with earlier versions, the code in this tutorial was tested with Eclipse V3.2.2, which was the latest official release at the time of this writing.
  2. JDK V1.5 or later, from IBM or Sun Microsystems Some Java features new to version 5 are used in this tutorial to a very small degree, such as Annotations and Generics.


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community