2

我想在 E4 RCP 应用程序启动后运行一些东西。

怎么做?

4

1 回答 1

6

你可以用一个LifeCycle类来做到这一点。lifeCyceURI您在产品的属性中指定:

<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>
     ....

PostContextCreate注释在启动的早期运行:

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

请参阅注册 Eclipse 4 应用程序生命周期

于 2013-12-20T13:06:21.297 回答