How to use Eclipse 3.x views in E4?

六眼飞鱼酱① 提交于 2019-12-06 11:59:40

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. 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

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.

New to eclipse

From what I have searched till today, you cannot use existing Eclipse UI plugins like org.eclipse.debug.ui, org.eclipse.ui.console, etc in a pure e4 application (org.eclipse.e4.ui.workbench.swt.E4Application). So if you need to use existing UI components you have to create a 3.x application (implements IApplication, references ApplicationWorkbenchAdvisor, PlatformUI etc). So as of today if you want to use existing UI plugins you have to create a 3.x RCP which runs over the compatibility layer with the new 4.x runtime. This is so simple but hardly written clearly anywhere and I had to spend some time figuring it out. Discouraging introduction to Eclipse RCP.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!