wei
wei

Reputation: 6889

Is it possible to extend Eclipse with a plugin?

I am not familiar with Eclipse plugin development. The examples I have found online so far all show how to create a plugin to add new functionalities to Eclipse. But what I really want is to extend an existing functionality with some new additions.

For example, I want to add a new tab to the CDT's Code Style preference page to add more configure options. Of course, this also involves the backend style configure options, not just the UI.

Thanks.

Upvotes: 0

Views: 148

Answers (1)

Francis Upton IV
Francis Upton IV

Reputation: 19443

I think you can extend a plugin by altering its declarations in the plugin.xml using Equinox Transforms. So in this case you might be able to change the extension point that refers to the CDT preferences to use your own subclass of the CDT preferences (this assumes that the CDT preference page is subclassable). However this is pretty messy and is likely to break in newer Eclipse versions.

In general with Eclipse it's difficult to extend existing plugins except as they have defined API or extension points to do so, and these are usually documented. If you follow APIs or extension points then you should be compatible across newer Eclipse versions as they do a pretty good job of not changing these things in an incompatible way. If you extend things by using internal knowledge, things are subject to break in any new Eclipse release.

Unfortunately there is not a way (in OSGi) to put your code in from of the code in some plugin (using a fragment) unless the plugin explicitly provides for that case (by loading a pre-defined Jar file that might be provided in the fragment), so there is not a way to replace arbitrary classes in a plugin with your own versions.

Upvotes: 1

Related Questions