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

Ask A Question

Stats

  • Questions 79k
  • Answers 79k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should be able to Edit the fonts and colors… May 11, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer The ZedGraphControl allows Pan & Zoom to be controlled through… May 11, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer The connection string should look something like: < add name="MyConnectionString"… May 11, 2026 at 4:05 pm

Related Questions

I'm building an Eclipse plugin that talks to a REST interface which uses Basic
I would like to add a BuildListener to my headless build process, which is
I have a fairly large PHP codebase (10k files) that I work with using
I am trying to build an Eclipse application that would work with a linux/motif

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.