図5:IPerspectiveFactoryインタフェースの実装例

⁄**
 * 一括制御機能のパースペクティブを生成するクラスです。
 *⁄
public class CollectiveRunPerspective implements IPerspectiveFactory {

    public void createInitialLayout(IPageLayout layout) {
        //アクションセットを追加
        layout.addActionSet("com.clustercontrol.ActionSet");

        (中略)

        layout.addActionSet("com.clustercontrol.snmp.ActionSet");
        
        //エディタ領域を非表示にする
        layout.setEditorAreaVisible(false);

        //エディタ領域のIDを取得
        String editorArea = layout.getEditorArea();
        //エディタ領域の上部60%を占めるフォルダを作成
        IFolderLayout top = layout.createFolder("top", IPageLayout.TOP,
                (float) 0.60f, editorArea);
        //ID=topのフォルダの左側40%を占めるフォルダの作成
        IFolderLayout topLeft = layout.createFolder("topLeft",
                IPageLayout.LEFT, (float) 0.40f, "top");
        //エディタ領域の下部40%を占めるフォルダを作成
        IFolderLayout bottom = layout.createFolder("bottom",
                IPageLayout.BOTTOM, (float) 0.40f, editorArea);
        topLeft.addView(ParameterView.ID);
        top.addView(HistoryView.ID);
        bottom.addView(DetailView.ID);
    }
}

人気記事トップ10

人気記事ランキングをもっと見る