*[[FAQ How do I find all the plug-ins that contribute to my extension point?]]

{{Template:FAQ_Tagline}}

{{Template:FAQ_Tagline}}

Latest revision as of 12:23, 6 January 2008

Declaring an extension point is arguably one of the more difficult and less documented and supported tasks in Eclipse. Most plug-in writers simply copy an extension point schema from others to get an approximation of what they need.

Adding an extension point can be done with some PDE support by following these steps.

Now stop for a minute. Think up a good name and an equally descriptive ID for your extension point. Don&#146;t choose too lightly. These two names are part of your plug-in API. The ID is one word without dots; your plug-in ID will be prepended to it. When in doubt, press F1 to get help.

Choose a name for your schema. This file name is private to you, so you can choose any name you like. Check the box to edit the schema. Click Finish to launch the PDE Schema Editor to edit the schema.

Click New Element; in the properties view, change the name to the extension element you want your clients to fill in.

Add a new attribute to this element, and call it id. Change the value of Use to Required. In the Properties view, click the Clone this attribute button in the local toolbar.

Rename the clone to name. Clone it.

Rename the second clone to class. Change the kind to java.

Choose the interface your contributors need to implement or the class they need to subclass. Note that it is generally better to provide a superclass, as this allows you greater flexibility in extending the API in the future without breaking existing implementations. Choose a descriptive name that captures the meaning of the collaboration between you and your contributors.

In the Based On property, enter the name of the interface/class to create an executable extension from.

That&#146;s it. You now have defined a new extension that others can contribute to. Look around in the editor and add descriptions, documentation, and example code where appropriate.

If you want to customize the extension with more attributes, read Help > Help Contents... > PDE Guide > Extension Point Schema > Extension point schema editor.