自定义Eclipse透视图,初始隐藏视图堆叠到编辑区 [英] Custom Eclipse perspective, with initially invisble view stacked to editor area
问题描述
我有一个自定义的perspecitve与编辑器区域在plugin.xml中声明。
另外,我有一个自定义视图,它是以编程方式打开的。我想用编辑器区域堆叠这个视图。
如果我将它设置在透视扩展名中,最初是可见的,一切都正常。
< view
id =my.viewID
minimize =false
relationship =stack
relative =org.eclipse.ui.editorss
visible =false >
< / view>
但是,如果我设置 visible =false
,并使用以下代码以编程方式打开,它始终显示在与ConsoleView堆叠的底部区域。
IViewPart viewPart = PlatformUI.getWorkbench()。getActiveWorkbenchWindow()。getActivePage()
.showView(my.viewID,secondID,IWorkbenchPage.VIEW_ACTIVATE);
有没有人知道如何以编程方式打开堆栈到编辑区域的初始隐藏视图? p>
我已经尝试了本线程中提供的建议,但没有任何成功: Eclipse RCP - 相对视角透视扩展不起作用
有时您无法想象如何简单的解决方案:
只需添加:*
plugin.xml中的视图ID的结尾解决了这个问题:
< view
id =my
minimize =false
relationship =stack
relative =org.eclipse.ui.editorss
visible =false>
< / view>
令人难以置信的是,您发现有多少次人说这是不可能的...
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 the editor area. If I set it in the perspective extension as initially visible, everything works fine.
<view
id="my.viewID"
minimized="false"
relationship="stack"
relative="org.eclipse.ui.editorss"
visible="false">
</view>
However, if I set visible="false"
, and use the following code to open it programmatically, it always appears in the bottom area stacked with the ConsoleView.
IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.showView("my.viewID", "secondID", IWorkbenchPage.VIEW_ACTIVATE);
Does anybody know how to have an initially invisble view stacked to the editor area when opened programmatically?
I already tried the recommendations given in this thread but without any success: Eclipse RCP - relative field of view perspective extension not working
Sometimes you can't imagine how simple solutions can be:
Simply adding :*
at the end of the view id in the plugin.xml solved this issue:
<view
id="my.viewID:*"
minimized="false"
relationship="stack"
relative="org.eclipse.ui.editorss"
visible="false">
</view>
Unbelievable how many times you find people saying this would not be possible at all...
这篇关于自定义Eclipse透视图,初始隐藏视图堆叠到编辑区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!