ラベル Eclipse の投稿を表示しています。 すべての投稿を表示
ラベル Eclipse の投稿を表示しています。 すべての投稿を表示

外部プラグインフォルダの利用のメモ

EclipseでPDE or RCPの開発を行う場合は、開発中プラグインが依存するプラグインを

外部プラグインフォルダに配置すると、何かと便利ですね。

 

上のやり方だと、Eclipseの標準プラグインと格納場所が同じになってしまうので
若干の不便が生じます。
追加プラグイン専用のディレクトリを作って、そこで管理することが可能です。

Eclipse3では、使用方法が2と違うので注意して下さい。
まず、適当なディレクトリ以下に「eclipse」ディレクトリを生成します。
他の名前ではいけません。
次に、作成したディレクトリ以下に「plugins」「features」という名前のディレクトリを作成します。
さらに、同じディレクトリ上に「.eclipseextension」というファイルを作成します。
内容はこんな感じにします。

name=Eclipse Platform ext
id=org.eclipse.platform.ext
version=3.0.0

作成したプラグインをpluginsディレクトリ以下に展開したら、
Eclipse上からこのプラグインフォルダを登録します。

Helpメニューから「Software Updates」→「Manage Configuration...」を選択します。
開かれたウィンドーの右ペインから「Add an Extension Location」をクリックします。
ディレクトリ選択ダイアログが開くので、ここで先ほど作成したeclipseディレクトリを指定します。

Eclipseを再起動する確認が促されますので、再起動すれば完了です。
ディレクトリ名が違ったり「.eclipseextension」ファイルが無かったりすると
エラーが発生します。

 

Eclipseプラグインを作成する

SWT のウィジェットをレイアウトの管理対象から除外する

GridData.exclude が レイアウトの管理対象から除外するかどうかのフラグになっている点がポイントですね。

 

package snippet;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;

/*
 * Exclude a widget from a GridLayout
 * 
 * For a list of all SWT example snippets see
 * http://www.eclipse.org/swt/snippets/
 * 
 * @since 3.1
 */

public class Snippet175 {

	public static void main(String[] args) {

		Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(3, false));

		Button b = new Button(shell, SWT.PUSH);
		b.setText("Button 0");

		final Button bHidden = new Button(shell, SWT.PUSH);
		bHidden.setText("Button 1");
		GridData data = new GridData();
		data.exclude = true;
		data.horizontalSpan = 2;
		data.horizontalAlignment = SWT.FILL;
		bHidden.setLayoutData(data);

		b = new Button(shell, SWT.PUSH);
		b.setText("Button 2");
		b = new Button(shell, SWT.PUSH);
		b.setText("Button 3");
		b = new Button(shell, SWT.PUSH);
		b.setText("Button 4");

		b = new Button(shell, SWT.CHECK);
		b.setText("hide");
		b.setSelection(true);
		b.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event e) {
				Button b = (Button) e.widget;
				GridData data = (GridData) bHidden.getLayoutData();
				data.exclude = b.getSelection();
				bHidden.setVisible(!data.exclude);
				shell.layout(false);
			}
		});
		shell.setSize(400, 400);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}

Eclipse RCPメモ

Tabbed Properties Viewの作り方

http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html

image

 

Adding Drag and Drop to an SWT Application

http://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html

image

Eclipse RCPのソフト: Papilio

image

Papilio

http://www.valtech.jp/papilio.htm

 

Eclipseプラグインで実現するバグトラッキングシステム(BTS)です。

 

特徴
  • サーバ構築不要。接続している各端末がお互いに同期してデータを共有する。
  • インストールは簡単。Eclipseにプラグインを追加するだけ。
  • 信頼度成長曲線などの充実したレポート出力機能
  • Eclipseを採用することで直感的操作が可能なインタフェースを実現。
  • 完全フリー、オープンソース。
  • 完全日本語対応