【问题标题】:Adding a view on perspective in particular folder在特定文件夹中添加透视图
【发布时间】:2018-11-27 01:02:11
【问题描述】:

在我的 Eclipse RCP 应用程序中,我有四个视图 A、B、C、D。我只想在应用程序启动时显示 A、B、C 视图,并在用户单击按钮时显示 D 视图。@ 987654321@

我正在动态添加视图

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("D_ViewID",null, IWorkbenchPage.VIEW_ACTIVATE);

此视图添加在底部,但我希望此 D 视图以这种方式与 B_View 相邻

我的透视代码在这里:

@Override
public void createInitialLayout(IPageLayout layout) {

    String editor = layout.getEditorArea();
    layout.setEditorAreaVisible(false); 

    IFolderLayout top=layout.createFolder("view",IPageLayout.TOP , 0.80f, editor);
    top.addView(B.ID);

    layout.addView(A.ID, IPageLayout.LEFT, 0.20f, BrowserView.B);           
    layout.addView(c.ID, IPageLayout.BOTTOM, 0.20f,editor); 
}

【问题讨论】:

  • 可能是org.eclipse.ui.actionSets 扩展点会在这里为您提供帮助

标签: eclipse-plugin eclipse-rcp eclipse-3.6


【解决方案1】:

您需要 add a placeholder 到透视图,就像您添加了已经可见的视图一样。如果您查看IPageLayout documentation 的顶部,有一个示例将书签视图添加为占位符。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-01
    • 2010-11-10
    • 1970-01-01
    • 2010-11-18
    • 1970-01-01
    • 1970-01-01
    • 2015-07-13
    • 1970-01-01
    相关资源
    最近更新 更多