Custom Eclipse perspective, with initially invisble view stacked to editor area

前端 未结 2 1038
眼角桃花
眼角桃花 2021-01-06 17:09

I got a custom perspecitve with an editor area declared in plugin.xml only. In addtion, I got a custom view, that is opened programatically. I want to stack this view with t

2条回答
  •  执笔经年
    2021-01-06 17:43

    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!

提交回复
热议问题