Eclipse e4:IStartup扩展不起作用 [英] Eclipse e4 : IStartup extension not working

查看:109
本文介绍了Eclipse e4:IStartup扩展不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试扩展 org.eclipse.ui.startup扩展点。
,但是在eclipse e4中似乎没有被调用。
是此扩展在eclipse e4(Juno)中被破坏

I am trying to extending "org.eclipse.ui.startup" extendion point. but it seems in eclipse e4 ,it does not even getting called. is this extension is broken in eclipse e4(Juno)

推荐答案

我遇到了同样的问题,找不到一个答案,但是在此过程中,我发现了LifeCycleHandler,这对我而言甚至更好。

I had the same problem and couldn't find an answer, but in the process I discovered the LifeCycleHandler which is even better for my purpose. It might be a good alternative for you as well.

就像启动扩展一样,您可以从plugin.xml中引用处理程序:

Just as with the startup-extension you can reference a handler from your plugin.xml:

<property name="lifeCycleURI" value="platform:/plugin/<plug-in-id>/<path-to-handler-class>" />

在处理程序中,您可以使用批注标记要调用的方法以及依赖项注入:

In the handler you can use annotations to mark the method that is to be invoked as well as dependency injection:

public class StartupHandler {
    @Inject
    Foo bar;

    @PostContextCreate
    public void startup(IEclipseContext context) {
       // do something
    }
}

您可以在此处找到详细的示例: https://marcteufel.wordpress.com/2011/05/05/231/

You can find a detailed example here: https://marcteufel.wordpress.com/2011/05/05/231/

这篇关于Eclipse e4:IStartup扩展不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆