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

サムネイル作成サイト

このblogで表示しているWebサイトのサムネイルは「」を利用させて頂いています。

作者様に感謝。

 

image

jQueryサンプル集

34個もjQueryのサンプルを紹介されてます。

http://www.designwalker.com/2008/04/jquery.html

TODO

EclipseのRCP開発で、Target Platformを指定するのか調査。

JUnit4 あれこれリンク

JUnit4 OfficialSite

http://junit.org/

 

JUnit4 - TRANCE ARTS 技術情報Wiki

http://www.trance.co.jp/wiki/index.php?JUnit4

 

JUnit4をやってみよう

http://www7b.biglobe.ne.jp/~archer/tryjunit4/tryjunit4.html

 

JUnit4.4のassertThatを使ってみた

http://d.hatena.ne.jp/masanobuimai/20071007#1191769653

 

hamcrest

http://code.google.com/p/hamcrest/

 

Quick JUnit Plugin for Eclipse

http://quick-junit.sourceforge.jp/

Eclipse RCPのソフト: Papilio

image

Papilio

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

 

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

 

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

「Google Collections Library」でJavaのコレクションを補完する

image

最近、型推論によるCollectionsを扱う記事をよく見かけるようになりました。

Genericsで記述すると、どうしても冗長なので、必要十分な情報でシンプルに記述できることはよいこです。

 

ということで、2つご紹介。

どっいがいいかなぁ。

 

「Google Collections Library」でJavaのコレクションを補完する

http://codezine.jp/a/article/aid/2397.aspx?p=1

 

Javaの型推論Utilsクラス

http://d.hatena.ne.jp/yukoba/20080414/p1

AVATAR MAKEでアバター作成

 

AVATAR MAKEでアバターを作ってみました。

 

たくさんのパターンがパーツから、アバターを作れるので、きっと自分のお気に入りが作れますよ。

Windows Live Writerプラグイン5選

  • Polaroid Picture

任意の画像をポラロイド写真風に加工してブログ記事に挿入できるプラグイン。

Polaroid Picture (ユーザーの評価: 34)

ダウンロード数: 5721


  • Insert Website Image

任意のWebページをキャプチャーして、そのサムネイル画像をブログ記事に付けられるプラグイン。Insert Website Image

(ユーザーの評価: 8)

ダウンロード数: 2915


  • SyntaxHighlighter for Windows Live Writer

ソースコード色付け(ハイライト)のためSyntaxHighlighter用のHTMLタグを付けて挿入するプラグイン。

別途SyntaxHighlighter(http: //code.google.com/p/syntaxhighlighter/)をダウンロードしてBlogの設定が必要.。

SyntaxHighlighter for Windows Live Writer

(ユーザーの評価: 1)

ダウンロード数: 455


  • Amazon Associate Japan

検索キーワードとカテゴリで、日本アマゾンから商品を検索。検索結果一覧から、サムネイル画像付きで、プレビュー。選択することで、WLWに、リンクつきで挿入するプラグイン。

Amazon Associate Japan

(ユーザーの評価: 3)

ダウンロード数: 530


  • Blog This for Firefox

Firefoxで選択部分をWindowsLiveWriterに渡して、投稿記事の作成ができるプラグイン。 Blog This for Firefox

(ユーザーの評価: 22)

ダウンロード数: 12052

blogger初投稿

image

今まで、blogははてなダイアリーを利用してたんだけど、WindowsLiveWriter(WLW)に対応していないので、bloggerに乗り換えようかと。

この記事も、WLWから投稿しているけど、なかなか快適x2。

Windows2003Serverの場合、WLWのインストールができないので 、.NET3.5をインストールして、MSI版のWLWをインストールするとうまくインストールできました。