rcp 視圖佈局

 

public class Perspective implements IPerspectiveFactory {

    public void createInitialLayout(IPageLayout layout) {

        String editorArea = layout.getEditorArea();//得到編輯區域

        layout.setEditorAreaVisible(false);//設置是否顯示編輯區域

        layout.setFixed(true);//設置當前佈局是否固定

//定義一個視圖, IPageLayout.ID_EDITOR_AREAeditorArea作用是一樣的

        layout.addView(MenuView.ID, IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA);

        layout.addView(CustomerListView.ID, IPageLayout.TOP, .6f, editorArea);

//定義一個文件夾視圖,可以向文件夾中放視圖,文件夾視圖放在之前的MenuView視圖中

        IFolderLayout folderBottom = layout.createFolder("left", IPageLayout.BOTTOM, .7f, MenuView.ID);

        folderBottom.addView(QuickAddCustomerView.ID);//向文件夾中發視圖

        folderBottom.addView(QuickAddRelationView.ID);

        }

注意:layout.addStandaloneView(View.ID,  false, IPageLayout.LEFT, 1.0f, editorArea);//在頁面中添加一個單一的、不能和其他視圖共享同一位置的視圖。除非該視圖關閉,否則該視圖的標題不會被隱藏。

 

發佈了49 篇原創文章 · 獲贊 7 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章