如何在E4中使用Eclipse 3.x视图? [英] How to use Eclipse 3.x views in E4?

查看:193
本文介绍了如何在E4中使用Eclipse 3.x视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Eclipse 3.x开发很有经验,现在想开发一个E4应用程序。因此,我测试了一个简单的例子,以便开始使用新的东西。

I am experienced with Eclipse 3.x development and now want to develop an E4 application. Therefor I tested a simple example in order to get started with the new things.

我正在关注本教程一步一步但它会导致相同的错误。但是,他没有得到这些错误。

I was following this tutorial step by step but it results in the same error. However, he is not getting those errors.

我正在使用Eclipse Luna(4.4.2)并安装 E4工具(0.17)
我创建了一个新的Eclipse 4应用程序并添加到 Application.e4xmi 公共资源导航器(Project Explorer)作为共享部件使用Import 3x - > View as CompatibilityView。然后我添加了一个引用共享部分的占位符。我已将所有必要的插件添加到产品的依赖项中。我还添加了兼容性插件。

I'm using Eclipse Luna (4.4.2) and installed the E4 Tools (0.17). I've created a new Eclipse 4 Application and added to the Application.e4xmi the Common Resource Navigator (Project Explorer) as Shared Part using Import 3x -> View as CompatibilityView. I then added a Placeholder which references the shared part. I have added all necessary plugins to the product's dependencies. I also have added the compatibility plugins.

然而,当我启动应用程序时,我在<$获得 InjectionException c $ c> InjectorImpl #internalMake()#331 这只是:

However, when I start the application I get an InjectionException at InjectorImpl#internalMake()#331 which simply is:

if (unresolved(actualArgs) != -1) continue;

调试 unresolved()让我去以下几点( InjectorImpl#489 ):

Debugging unresolved() let me to the following point (InjectorImpl#489):

Creatable creatableAnnotation = desiredClass.getAnnotation(Creatable.class);

desiredClass 的等级 org.eclipse.ui.internal.ViewReference 。
然后函数返回1,导致继续大写和异常。堆栈跟踪如下(在此处完整):

!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-05-06 13:00:05.899
!MESSAGE Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityView' from bundle '96'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.ui.internal.e4.compatibility.CompatibilityView
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:346)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
...


推荐答案

要解决这个问题,我必须遵循这个很棒的教程。正如@ greg-449已经提到的那样,你必须使用3.x RCP并在其上放置一个 e4识别产品。然后将初始化兼容层。因此,您必须执行以下操作(教程详细描述):

To solve this problem, I had to follow this awesome tutorial. As @greg-449 already mentioned you've to use an 3.x RCP and put an e4 aware product on top of it. Then the compatibility layer will be initialized. Thus, you have to do the following (the tutorial describes it in detail):


  1. Eclipse创建一个Ecliplse-Plugin 3.5或更新

  2. 勾选将为UI做出贡献

  3. 使用 Hello World RCP生成所需的扩展点

  4. Ctrl + N - > Eclipse 4 - >模型 - >新的应用程序模型

  5. 添加一个扩展点

  6. Ctrl + N - >插件开发 - >产品配置

  1. create an Ecliplse-Plugin which for Eclipse 3.5 or newer
  2. Tick Will make contributions to the UI
  3. Use the Hello World RCP to generate the required extension points
  4. Ctrl+N -> Eclipse 4 -> Model -> New Application Model
  5. Add an extension point
  6. Ctrl+N -> Plug-in Development -> Product Configuration

rest在链接教程中描述。 忘记将 -clearPersistedState 添加到产品的启动选项中。因此,您将看到应用程序模型的增量。如果您要使用基于功能的产品,则应创建一个引用RCP插件的功能插件,并将其作为依赖项添加到产品中。因此,您不必按照教程中的描述更改运行配置。

The rest is described in the linked tutorial. Do not forget to add -clearPersistedState to the Launching options of the product. So you will see your deltas of your application model. If you are going to use a feature based product you should create a feature plugin which references your RCP plugin and add it as dependency to the product. Thus, you don't have to change the run configuration as described in the tutorial.

这篇关于如何在E4中使用Eclipse 3.x视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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