Eclipse/プラグイン開発のTIPS集/RCP
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
#topicpath
----
#contents
**概要 [#lc70b365]
Eclipseのプラグインを勉強しているついでに、Eclipse3.0で導...
前々からEclipseをベースにして、開発ツール(WebSphereStudio...
手順はプラグインを作るのと基本的に一緒です。必ず作らなく...
-org.eclipse.core.runtime.IPlatformRunnable の実装クラス(...
-org.eclipse.ui.application.WorkbenchAdvisor のサブクラス...
-org.eclipse.ui.IPerspectiveFactory の実装クラス(パースペ...
です。
***IPlatformRunnable の実装クラス [#l49f6af6]
IPlatformRunnable の実装クラスはrunメソッドをオーバーライ...
public Object run(Object args) throws Exception {
// WorkbenchAdvisorの作成
WorkbenchAdvisor advisor = new SampleWorkbenchAdvisor();
Display display = PlatformUI.createDisplay();
try {
int ret = PlatformUI.createAndRunWorkbench(display, ...
if (ret == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
} else {
return IPlatformRunnable.EXIT_OK;
}
} finally {
display.dispose();
}
}
***WorkbenchAdvisor のサブクラス [#s83eece8]
ワークベンチ(ウィンドウとか、外枠、みたいなイメージ)を構...
public String getInitialWindowPerspectiveId() {
return "nu.mine.kino.sample.SamplePerspectiveFactory";
}
***IPerspectiveFactory の実装クラス [#l2b25add]
RCPアプリケーションで使用するパースペクティブを構築します...
public void createInitialLayout(IPageLayout layout) {
layout.addView("nu.mine.nu.sample.SampleView", IPageLa...
IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
}
("nu.mine.nu.sample.SampleView"というIDのビューをパースペ...
**実際にやってみる。 [#c69ff7cc]
-新規 >> プラグイン・プロジェクト を選択。
-プロジェクト名に nu.mine.kino.sample と入れて「次へ」を...
#ref(01.png)
#ref(02.png)
-plugin.xmlのエディタが起動するので、Dependenciesで
org.eclipse.ui
org.eclipse.core.runtime
を追加。
-Extensionsで使用する拡張ポイントを追加。追加する拡張ポイ...
org.eclipse.ui.perspectives
org.eclipse.core.runtime.applications
です。''org.eclipse.core.runtime.applications はIdを指定...
#ref(04.png)
-上の拡張ポイントに追加したapplicationやperspectiveの具象...
nu.mine.kino.sample.SampleApplication
nu.mine.kino.sample.SamplePerspectiveFactory
というID/Class名のクラスを作成しました。最終的にplugin.xm...
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="nu.mine.kino.sample"
name="Sample プラグイン"
version="1.0.0"
provider-name="">
<runtime>
<library name="sample.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>
<extension
id="SampleApplication"
point="org.eclipse.core.runtime.applications">
<application>
<run class="nu.mine.kino.sample.SampleApplicati...
</application>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="nu.mine.kino.sample.SamplePerspective...
name="サンプル・パースペクティブ"
id="nu.mine.kino.sample.SamplePerspectiveFac...
</extension>
</plugin>
-プラグインエディタから作成したクラス2つに上で書いた内容...
最終的に以下のファイルができあがりました。
#ref(SampleApplication.java)
#ref(SamplePerspectiveFactory.java)
#ref(SampleWorkbenchAdvisor.java)
#ref(plugin.xml)
***いよいよ実行 [#aef8b688]
いよいよ実行します。ランタイムワークベンチを作成して、プ...
#ref(05.png)
また、プラグインおよびフラグメントタブ内で、自分が作成し...
#ref(06.png)
以上でランタイムワークベンチを起動すると、何にもビューを...
#ref(07.png)
コンソールに"nu.mine.nu.sample.SampleView"なんてビューね...
***products拡張ポイントについて [#v89ca80d]
Eclipseのサイトに[[Branding your application:http://www.e...
さてorg.eclipse.core.runtime.applications 拡張ポイントで...
<extension id="product" <-このIDを指定しないと、使えない...
point="org.eclipse.core.runtime.products">
<product
name="%productName"
application="nu.mine.kino.sample.SampleApplication">
↑[プラグインのID].[org.eclipse.core.runtime.applicat...
</extension>
あとはpropertyタグでさまざまなプロパティを設定することで...
----
この記事は
#vote(おもしろかった[25],そうでもない[3])
#topicpath
SIZE(10){現在のアクセス:&counter;}
終了行:
#topicpath
----
#contents
**概要 [#lc70b365]
Eclipseのプラグインを勉強しているついでに、Eclipse3.0で導...
前々からEclipseをベースにして、開発ツール(WebSphereStudio...
手順はプラグインを作るのと基本的に一緒です。必ず作らなく...
-org.eclipse.core.runtime.IPlatformRunnable の実装クラス(...
-org.eclipse.ui.application.WorkbenchAdvisor のサブクラス...
-org.eclipse.ui.IPerspectiveFactory の実装クラス(パースペ...
です。
***IPlatformRunnable の実装クラス [#l49f6af6]
IPlatformRunnable の実装クラスはrunメソッドをオーバーライ...
public Object run(Object args) throws Exception {
// WorkbenchAdvisorの作成
WorkbenchAdvisor advisor = new SampleWorkbenchAdvisor();
Display display = PlatformUI.createDisplay();
try {
int ret = PlatformUI.createAndRunWorkbench(display, ...
if (ret == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
} else {
return IPlatformRunnable.EXIT_OK;
}
} finally {
display.dispose();
}
}
***WorkbenchAdvisor のサブクラス [#s83eece8]
ワークベンチ(ウィンドウとか、外枠、みたいなイメージ)を構...
public String getInitialWindowPerspectiveId() {
return "nu.mine.kino.sample.SamplePerspectiveFactory";
}
***IPerspectiveFactory の実装クラス [#l2b25add]
RCPアプリケーションで使用するパースペクティブを構築します...
public void createInitialLayout(IPageLayout layout) {
layout.addView("nu.mine.nu.sample.SampleView", IPageLa...
IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
}
("nu.mine.nu.sample.SampleView"というIDのビューをパースペ...
**実際にやってみる。 [#c69ff7cc]
-新規 >> プラグイン・プロジェクト を選択。
-プロジェクト名に nu.mine.kino.sample と入れて「次へ」を...
#ref(01.png)
#ref(02.png)
-plugin.xmlのエディタが起動するので、Dependenciesで
org.eclipse.ui
org.eclipse.core.runtime
を追加。
-Extensionsで使用する拡張ポイントを追加。追加する拡張ポイ...
org.eclipse.ui.perspectives
org.eclipse.core.runtime.applications
です。''org.eclipse.core.runtime.applications はIdを指定...
#ref(04.png)
-上の拡張ポイントに追加したapplicationやperspectiveの具象...
nu.mine.kino.sample.SampleApplication
nu.mine.kino.sample.SamplePerspectiveFactory
というID/Class名のクラスを作成しました。最終的にplugin.xm...
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="nu.mine.kino.sample"
name="Sample プラグイン"
version="1.0.0"
provider-name="">
<runtime>
<library name="sample.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>
<extension
id="SampleApplication"
point="org.eclipse.core.runtime.applications">
<application>
<run class="nu.mine.kino.sample.SampleApplicati...
</application>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="nu.mine.kino.sample.SamplePerspective...
name="サンプル・パースペクティブ"
id="nu.mine.kino.sample.SamplePerspectiveFac...
</extension>
</plugin>
-プラグインエディタから作成したクラス2つに上で書いた内容...
最終的に以下のファイルができあがりました。
#ref(SampleApplication.java)
#ref(SamplePerspectiveFactory.java)
#ref(SampleWorkbenchAdvisor.java)
#ref(plugin.xml)
***いよいよ実行 [#aef8b688]
いよいよ実行します。ランタイムワークベンチを作成して、プ...
#ref(05.png)
また、プラグインおよびフラグメントタブ内で、自分が作成し...
#ref(06.png)
以上でランタイムワークベンチを起動すると、何にもビューを...
#ref(07.png)
コンソールに"nu.mine.nu.sample.SampleView"なんてビューね...
***products拡張ポイントについて [#v89ca80d]
Eclipseのサイトに[[Branding your application:http://www.e...
さてorg.eclipse.core.runtime.applications 拡張ポイントで...
<extension id="product" <-このIDを指定しないと、使えない...
point="org.eclipse.core.runtime.products">
<product
name="%productName"
application="nu.mine.kino.sample.SampleApplication">
↑[プラグインのID].[org.eclipse.core.runtime.applicat...
</extension>
あとはpropertyタグでさまざまなプロパティを設定することで...
----
この記事は
#vote(おもしろかった[25],そうでもない[3])
#topicpath
SIZE(10){現在のアクセス:&counter;}
ページ名: