I would like to run some code once the e4 application is initialized and the workbench started. In Eclipse 3.x, I would put this in the method "initialize" of the class ApplicationWorkbenchAdvisor.
What is the best way to implement this in the e4 framework?
@Joseph
The code I would like to run would initialize listeners and start new threads. For instance, if a file has been in the command line arguments, this file would be opened and run.
@Christoph
I already did some tests with @PostContextCreate and @ProcessAdditions. The problem is that when these methods are called, the workbench is not ready yet.
My guess is that I would need to register to IEventBroker for some events such that when the main window has been opened. There is a few things on the life cycle of a part in the tutorials from Vogella on e4 but nothing about the lifecycle of the shell, the workbench or the main window.
Thank you. Reading the discussion was informative: I understand now that there is no easy way to define that an application is started.
I have tried to subscribe to the UIEvents.UILifeCycle.ACTIVATE event using the code you suggested. Somehow, the method postContextCreate is called but the event is never triggered. Any idea ?
thank you for the tip. I was doing something similar but registering my event logger only in @ProcessAdditions: I was missing most of the UI initialization events.