Question

I want to run something exactly after E4 RCP application starts.

How to do that?

Was it helpful?

Solution

You can do this with a LifeCycle class. You specify this in the lifeCyceURI property of your product:

<extension
     id="product"
     point="org.eclipse.core.runtime.products">
  <product
        name="%product.name"
        application="org.eclipse.e4.ui.workbench.swt.E4Application">
     <property
           name="lifeCycleURI"
           value="bundleclass://plugin-id/package.LifeCycle">
     </property>
     ....

The PostContextCreate annotation runs very early in the startup:

public class LifeCycle
{
  @PostContextCreate
  public void postContextCreate()
  {
  }
}

See Register for the Eclipse 4 Application Life Cycle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top