#topicpath
----
//ここにコンテンツを記述します。
自分用のパースペクティブを作成したいときはorg.eclipse.ui.IPerspectiveFactory を使用します。このクラスのpublic void createInitialLayout(IPageLayout layout)メソッド内で、IPageLayoutのインスタンスに対して
-ビューの配置
-ツールバーやメニューバーへの設置

などを行います。

***拡張ポイント
 org.eclipse.ui.perspectives

***plugin.xmlのサンプル
  <extension point="org.eclipse.ui.perspectives">
   <perspective name="パースペクティブ名"
     icon="icons/sample.gif" <-アイコン
     class="nu.mine.kino.example.MyPerspectiveFactory" <-実装クラス
     id="nu.mine.kino.example.MyPerspectiveFactory"> <-ID
   </perspective>
 </extension>


**ポイント
***ビューの配置
基本的に、エディタエリアの取得を行い、その場所から相対的な位置を指定してビューを配置していくようです。例えば、
 //エディタの場所を取得。
 String editorArea = layout.getEditorArea();
 
 IFolderLayout topLeft =
   layout.createFolder("topLeft", IPageLayout.LEFT, 0.26F, editorArea);
 //"topLeft"という文字列の参照部分を作った <-第一引数。変数名でなく
 //この参照は、editorAreaのLEFTを指している。
 
 topLeft.addView("org.eclipse.ui.views.ResourceNavigator");
 
 IFolderLayout bottomLeft =
   layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.5F, "topLeft");
 //"bottomLeft"という文字列の参照部分を作った
 //この参照は、"topLeft"のLEFTを指している。
 
 //    よってこれはエディタから見て、左の下、つまり左下になる。
 bottomLeft.addView("org.eclipse.ui.views.ContentOutline");
の様に行います。ちなみに、IPageLayoutの定数ですが、
 public static final int LEFT = 1;
 public static final int RIGHT = 2;
 public static final int TOP = 3;
 public static final int BOTTOM = 4;
となっていました。








----
この記事は
#vote(おもしろかった,そうでもない)

#comment
#topicpath


SIZE(10){現在のアクセス:&counter;}

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS