如何在Eclipse E4应用程序中创建启动程序?

时间:2023-01-12 14:26:37

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

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

How to do that?

如何做呢?

1 个解决方案

#1


5  

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:

PostContextCreate注释在启动时非常早:

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

See Register for the Eclipse 4 Application Life Cycle

请参阅Eclipse 4应用程序生命周期的寄存器。

#1


5  

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:

PostContextCreate注释在启动时非常早:

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

See Register for the Eclipse 4 Application Life Cycle

请参阅Eclipse 4应用程序生命周期的寄存器。