Eclipse RCP - Stacking a view with the editor area?

徘徊边缘 提交于 2019-12-11 01:52:50

问题


Is it possible, when developing an Eclipse RCP Application, to stack a view with the editor area? Like this?

I have multiple lists/tables and I want to create a kind of preview composite. When an Item on a list is selected by single mouse click, I want my preview composite to show the data of the item.

If the user double clicks an item, I want to open an editor in the stack behind the preview composite.

Is there anyway to achieve this?

Thanks.


回答1:


No, there isn't. You could open a viewpart on the editor area but then, you will not be able to have editors and views as tabs




回答2:


Well, I've read most stuff about placing a view over the editor area, and none worked. The Answer 1 above causes the plugin.xml to have warnings. In Eclipse Luna, this works however when your perspective is initialized:

public void createInitialLayout(IPageLayout layout) {
  if ( layout instanceof org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout ) {
    org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout layout4=(org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout)layout;
    layout4.stackView(ID+":*",layout.getEditorArea(),false);
  }
  ...

The code above adds a view with "ID" that is a multiple view, added to the stack of editors hidden (last parameter is false="not visible").

It may also work with other Eclipse versions, but I haven't tried it.

Good luck!



来源:https://stackoverflow.com/questions/2758642/eclipse-rcp-stacking-a-view-with-the-editor-area

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