Search code examples
javaeclipseeclipse-rcpe4

Eclipse Rcp run E4 based code after the whole application has started and the GUI has completely rendered


i have an E3/E4 mixed application with compatibility layer. I would like to run E4 based code after the whole application has started and the GUI has completely rendered.

  • I tried to use a LifeCycle Manager but all annotations are to early for it.
  • I tried it in the ApplicationWorkbenchWindowAdvisor but there I have no access to the EModelService or MApplication.
  • As a processor extension I tried it too, but this is also too early the same for an Addon in the Application.e4xmi.

Is there maybe a listener or something similar where I can hook my code?

thank you


Solution

  • You can use the Application Startup Complete event for this.

    If you have a Life Cycle class just add a method like the following to the class:

    @Optional
    @Inject
    public void appStartupComplete(@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) final Event event)
    {
       ....
    }
    

    Or you can use the event broker to subscribe to the UIEvents.UILifeCycle.APP_STARTUP_COMPLETE event.

    Note: Event in the above is org.osgi.service.event.Event - there are several different Event classes so it is easy to get the wrong one.