Search code examples
eclipseeclipse-rcpeclipse-junoe4

Eclipse e4 : IStartup extension not working


I am trying to extending "org.eclipse.ui.startup" extendion point. but it seems in eclipse e4 ,it does not even getting called. is this extension is broken in eclipse e4(Juno)


Solution

  • I had the same problem and couldn't find an answer, but in the process I discovered the LifeCycleHandler which is even better for my purpose. It might be a good alternative for you as well.

    Just as with the startup-extension you can reference a handler from your plugin.xml:

    <property name="lifeCycleURI" value="platform:/plugin/<plug-in-id>/<path-to-handler-class>" />
    

    In the handler you can use annotations to mark the method that is to be invoked as well as dependency injection:

    public class StartupHandler {
        @Inject
        Foo bar;
    
        @PostContextCreate
        public void startup(IEclipseContext context) {
           // do something
        }
    }
    

    You can find a detailed example here: https://marcteufel.wordpress.com/2011/05/05/231/