Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6748637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:35:21+00:00 2026-05-26T12:35:21+00:00

I have an existing Eclipse plugin that provides an extension point. The plugin uses

  • 0

I have an existing Eclipse plugin that provides an extension point. The plugin uses standard Eclipse mechanism to find the extensions. In this plugin’s code, following code is used to get the extension.

IConfigurationElement[] config = Platform.getExtensionRegistry()
            .getConfigurationElementsFor(extensionPoint);
if (config.length > 0) {
    return config[0];
}

As you can see in the code, only the first found extension is used. This plugin already provides an extension and this extension is used in the default case.

Now I need to override the behavior of the default extension, so I created a new plugin and extends the same extension point. But it turns out that the default extension is always the first one in the IConfigurationElement array, so it’s always picked up.

How can I make my own plugin appear first in the found IConfigurationElement array, then my own plugin is used instead of the default one?

The existing plugin is written by others and I don’t want to make changes to it until it’s absolutely necessary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:35:21+00:00Added an answer on May 26, 2026 at 12:35 pm

    I’d say this is a bad way to get extensions from an extension point, either way. If they just want the use the pluginsystem to load a specific extension they have created, they could use the getConfigurationElementsFor(String namespace, String extensionPointName, String extensionId) method instead and close off the possibility for others to use the extension point. As of now there is no sure way of knowing which extension they will get. Chances are, there are instances in the code later on that assumes they will get their extension and when they don’t get the extension they expect, Mr ClassCastException comes knocking on the door. (Had a bug like this in a system once)

    Of course the best way is to change the code to handle many extensions!

    But to your question; I dont know how the ExtensionRegistry fills the array, the API doesnt say. Perhaps there is a way to perhaps set a specific version of your extension that will allow it to be placed first in the array. You would have to look in the code of the ExtensionRegistry to know exactly how the extensions are found. I think it may be in alphabetical order, but im not sure.

    Another way is to overload the existing plugin with your plugin and replace functionality. A very dirty approach, but in some cases it is doable. See one of my questions regarding this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have existing code that uses CMNewProfileSearch to find then iterate over the color
I have an Eclipse plugin that automatically loads existing Eclipse Java project to workspace,
I've installed the HgEclipse plugin for Mercurial integration in Eclipse. I have an existing
I have existing java code and need to create Design Document based on that.
I have an existing C++ source code that is built using autotools and i
I have an existing Crystal Reports .rpt that uses POJOs for its data source.
I have an Eclipse plugin that makes use of several keybindings (Alt-G x, Alt-G
I have an existing Dynamic Web Project in Eclipse Indigo and the m2e plugin
I have an existing program we've developed as a large set of Eclipse plugins.
(Eclipse 3.4, Ganymede) I have an existing Dynamic Web Application project in Eclipse. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.