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 90985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:57:33+00:00 2026-05-10T22:57:33+00:00

I am building an Eclipse plug-in that provides a set of core features in

  • 0

I am building an Eclipse plug-in that provides a set of core features in the regular plug-in project. The optional features I am providing via fragment projects. But I need the fragments to register themselves with the main plug-in on start-up.

I cannot have a Bundle-Activator in the fragment project. So I am wondering is there some alternate mechanism to declare an entry point or some call-back that I can hook?

And if there is no alternative other than converting the fragment project to a regular plug-in project is there a downside that I need to be aware of?

This is the solution I used based on the accepted answer:

final IExtensionRegistry registry = Platform.getExtensionRegistry(); final IExtensionPoint extensionPoint = registry.getExtensionPoint('myextensionid'); final IExtension[] extensions = extensionPoint.getExtensions(); for (int j = 0; j < extensions.length; ++j) {     final IConfigurationElement[] points = extensions[j].getConfigurationElements();     for (int i = 0; i < points.length; ++i)     {         if ('myelementname'.equals(points[i].getName()))         {             try             {                 final Object objImpl= points[i].createExecutableExtension('class');                 objImplList.add(provider);             }             catch (CoreException e)             {             }         }     } } 
  • 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. 2026-05-10T22:57:33+00:00Added an answer on May 10, 2026 at 10:57 pm

    You could define an extension point and lookup/call your fragment classes via extensions.

        IExtensionRegistry registry = Platform.getExtensionRegistry();     IExtensionPoint extensionPoint = registry             .getExtensionPoint('myplugin.myextension');     IConfigurationElement points[] = extensionPoint             .getConfigurationElements();     for (IConfigurationElement point : points) {         if ('myextensionFactory'.equals(point.getName())) {             Object impl = point.createExecutableExtension('class');             if (impl instanceof IMyExtension) {                 ((IMyExtension) impl).foo();             }         }     } } 

    EDIT:

    To use this approach I have to convert my fragments projects to plug-in projects. – bmatthews68

    You shouldn’t have to. For example, in my test code, I have the following files in the host plugin:

    META-INF/MANIFEST.MF:

    Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Myplugin Plug-in Bundle-SymbolicName: myplugin;singleton:=true Bundle-Version: 1.0.0 Bundle-Activator: myplugin.Activator Require-Bundle: org.eclipse.core.runtime Eclipse-LazyStart: true Export-Package: myplugin 

    plugin.xml:

    <?xml version='1.0' encoding='UTF-8'?> <?eclipse version='3.2'?> <plugin>     <extension-point id='myextension' name='myextension'         schema='schema/myextension.exsd' /> </plugin> 

    The fragment contains these files:

    META-INF/MANIFEST.MF:

    Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Myfragment Fragment Bundle-SymbolicName: myfragment;singleton:=true Bundle-Version: 1.0.0 Fragment-Host: myplugin;bundle-version='1.0.0' 

    fragment.xml:

    <?xml version='1.0' encoding='UTF-8'?> <?eclipse version='3.2'?> <fragment>    <extension          point='myplugin.myextension'>       <myextensionFactory             class='myfragment.MyExtension1'>       </myextensionFactory>    </extension> </fragment> 

    These projects were generated using Eclipse 3.3.1.1.

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

Sidebar

Related Questions

I'm building an Android application (as an Eclipse project) that needs to access a
Why would Eclipse, when building an Android project, get stuck in an infinite loop
Tycho is supposed to be a plug-in for maven for building eclipse plug-ins. I
I'm running eclipse with the Blackberry Java Plug-in, working on a 1.4.5 Blackberry project.
I am building my project using maven and eclipse. I am using the command
Suppose I am building a very simple eclipse plugin for creating new java projects.
I'm building a C++ project under Eclipse and my release folder should include a
I'm building an Eclipse Feature that has a requirement that amounts to this... The
When building Android project in Eclipse, Android SDK gives error like this: error: Description
Yesterday, my project was building and running fine. Today, Eclipse decided it doesn't recognize

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.