public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();//得到編輯區域
layout.setEditorAreaVisible(false);//設置是否顯示編輯區域
layout.setFixed(true);//設置當前佈局是否固定
//定義一個視圖, IPageLayout.ID_EDITOR_AREA和editorArea作用是一樣的
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);//在頁面中添加一個單一的、不能和其他視圖共享同一位置的視圖。除非該視圖關閉,否則該視圖的標題不會被隱藏。