Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » IStartup does not appear to work in Eclipse Mars
IStartup does not appear to work in Eclipse Mars [message #1703129] Tue, 28 July 2015 14:00 Go to next message
Eclipse UserFriend
I have a plug-in that has some start up initialization that takes long enough it cannot be done at the last second so it implements IStartup and has relied on the fact that start() will get called which kicks off a thread to do the initialization. Doing some debugging, the earlyStartup() method isn't being called at start-up under Mars. This used to work for Luna,. Is there a simple work-around or has this functionality been silently deprecated?
Re: IStartup does not appear to work in Eclipse Mars [message #1703131 is a reply to message #1703129] Tue, 28 July 2015 14:31 Go to previous messageGo to next message
Eclipse UserFriend
That approach has long been deprecated and support for it was temporarily removed in 4.5M5 but restored for 4.5M7.

Brian.
Re: IStartup does not appear to work in Eclipse Mars [message #1722510 is a reply to message #1703131] Fri, 05 February 2016 06:02 Go to previous message
Eclipse UserFriend
IStartup#earlyStartup() needs the compatibility layer, so it does not work in a pure E4 Application. (see #1)

To launch a process in a pure E4 Applicaiton you should use a lifecycle hook. So:

1. Reference your ApplicaitonLifecycle handler class from plugin.xml

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


2. write your Lifecycle Handler class

public class ApplicationLifecycleHandler {
    @PostContextCreate
    public void startup(IEclipseContext context) {
       // do initialization 
    }
}


3. Add an hook to handle events at Application Startup Complete

	@PostContextCreate
	public void postContextCreate(final IEventBroker eventBroker, etc .. ) {

		// 
		eventBroker.subscribe(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE,
				new EventHandler() {
					@Override
					public void handleEvent(Event event) {
						// Your code executed at startup,
						// after application startup is completed
					}
				});
		
	}





(#1) org.eclipse.ui.startup extension doc
Previous Topic:Performance problems with marker creation in an custom editor
Next Topic:Can't get Eclipse to listen for debugger connections
Goto Forum:
  


Current Time: Mon Mar 24 23:38:22 EDT 2025

Powered by FUDForum. Page generated in 0.03154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top