如何占用Eclipse UI中的可用空间?

时间:2014-01-06 19:16:11

标签: java layout user-interface swt eclipse-rcp

是否可以将一些视图放在布局的底部(1),然后将另一个视图放到剩余空间的左侧部分(2)?

整个区域是3。

enter image description here

1 个答案:

答案 0 :(得分:1)

是的,请看IPageLayout JavaDoc。它应该在您的视角IPerspectiveFactory.createInitialLayout(IPageLayout)中设置。略微修改那里给出的例子:

public void createInitialLayout(IPageLayout layout) {
    // Get the editor area.
    String editorArea = layout.getEditorArea();

    // Bottom left: Outline view and Property Sheet view
    IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 
        0.25f, editorArea);
    bottom.addView(IPageLayout.ID_OUTLINE);

    // Top left: Project Explorer view and Bookmarks view placeholder
    IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f,
        editorArea);
    topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);
    topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS);
}