本文介绍了如何在Eclipse E4应用程序启动时做一些事情?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何做到这一点?

解决方案

您可以使用 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()
{
}
}

请参阅


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

How to do that?

解决方案

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

这篇关于如何在Eclipse E4应用程序启动时做一些事情?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 22:53