如何在Eclipse E4应用程序中启动时创建一些东西?

时间:2013-12-20 12:37:00

标签: java eclipse osgi eclipse-rcp e4

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

怎么做?

1 个答案:

答案 0 :(得分: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()
  {
  }
}

请参阅Register for the Eclipse 4 Application Life Cycle