January 25, 2021
Hot Topics:

A First Look at Eclipse Plug-In Programming

  • By Koray Guclu
  • Send Email »
  • More Articles »
3.1.3. Requires tag

The requires tag defines the dependency of the plug-in. The requires tag defines the runtime dependency of the plug-in. If the tag is not correctly defined, you might be able to compile your plug-in but not run it.

 Source 4. plug-in.xml, requires tag
  <import plugin="org.eclipse.core.resources"/>

  <import plugin="org.eclipse.ui"/>

The HelloWorld plug-in depends on the org.eclipse.core.resource plug-in and depends on org.eclipse.ui plug-in. To use the import org.eclipse.core.resources.*statement and the org.eclipse.ui.plugin.* in Source 2, you need to define the plug-in IDs of these APIs in the requires tag.

We define the ID of the required plug-in in the require tag. This definition enables us to use the API classes of the plug-in. Table 2 shows the list of used APIs and plug-in IDs of the HelloWorld plug-in. The API package is the package that we import in our plug-in classes. The plug-in ID is the ID that we need to define in the requires tag. The org.eclipse.core.boot and org.eclipse.core.runtime plug-ins are special plug-ins. They are automatically defined as prerequisites of every plug-in. Therefore, their API packages are always available.

Table 2. Map of used platform plug-ins
API Packageplug-in id

If the requires tag is not correctly set, Eclipse might show something similar to the following error message in the console view.

 Console output
Could not create action delegate for id: de.korayguclu.eclipse.actions.SampleAction
Plug-in de.korayguclu.eclipse was unable to load class de.korayguclu.eclipse.actions.SampleAction.
3.1.4. Extension tag

An extension tag is used to extend an existing functionality of the another plug-in or Eclipse platform. The HelloWorld plug-in defines two extensions to add additional functionality to the existing extension points. The first extension defines new action sets and the second extension is used to add the first extension to the default (resource) perspective.

 Source 5. plug-in.xml, requires tag
<extension point="org.eclipse.ui.actionSets">
      label="Sample Action Set"
      <menu id="sampleMenu"
            label="Sample &amp;Menu">
        <separator name="sampleGroup"/>
       label="&amp;Sample Action"
        tooltip="Hello, Eclipse world">
<extension point="org.eclipse.ui.perspectiveExtensions">
    <actionSet id="de.korayguclu.eclipse.actionSet"/>


Java is strong on server platforms. Eclipse will bring Java to the desktop. Being an open source project will spread the use of Eclipse quickly. It makes it easy to improve the existing code or to adapt the existing code of the Eclipse platform.

Just like enterprise Java beans, Eclipse is a good candidate to be a container for a desktop application of the plug-in developers.

Many open source tools have been successfully used in business. Linux, Apache, JBoss, and StarOffice are examples of successful open source projects.

About the Author

Koray Güclü

He is working as a freelance author and software architect. He is currently finishing his book on Software Architectures and Design Patterns. His main interest areas are Software Architectures, Data Warehouses, and Database Modeling.




I would like to thank to Steve Gaiser for his valuable efforts in reviewing this text.



Page 5 of 5

This article was originally published on February 23, 2004

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date