How to make something on startup in Eclipse E4 application?

好久不见. 提交于 2019-12-02 06:09:42

问题


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

How to do that?


回答1:


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



来源:https://stackoverflow.com/questions/20703801/how-to-make-something-on-startup-in-eclipse-e4-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!