自分で作ったり提供したりするものは、まず自分自身で使ってみろろということです。自分じゃ使わないものなら人はいくらでも無責任にも無思考にもなれる。そういう投げやりな「サービス」やら「プロダクツ」なんて、だれだってイヤだ。自分が作り手と同時に利用者の立場になれば、ちゃんと使えるレベルのものを提供しようとします。

2010年4月15日木曜日

GWT Widgetサンプル

いろんなGoogle Web Toolkitウィジェットを触りました、サンプルデモを共有します。

サンプル

ソース明細:
SplitLayoutPanel p = new SplitLayoutPanel();
// p.addWest(new HTML("navigation"), 128);
// p.addNorth(new HTML("list"), 80);
// p.add(new HTML("details"));

// Make a command that we will execute from all leaves.
Command cmd = new Command()
{
    public void execute()
    {
        Window.alert("You selected a menu item!");
    }
};

// Make some sub-menus that we will cascade from the top menu.
MenuBar fooMenu = new MenuBar(true);
fooMenu.addItem("the", cmd);
fooMenu.addItem("foo", cmd);
fooMenu.addItem("menu", cmd);

MenuBar barMenu = new MenuBar(true);
barMenu.addItem("the", cmd);
barMenu.addItem("bar", cmd);
barMenu.addItem("menu", cmd);

MenuBar bazMenu = new MenuBar(true);
bazMenu.addItem("the", cmd);
bazMenu.addItem("baz", cmd);
bazMenu.addItem("menu", cmd);

// Make a new menu bar, adding a few cascading menus to it.
MenuBar menu = new MenuBar();
menu.addItem("ファイル", fooMenu);
menu.addItem("編集", barMenu);
menu.addItem("ヘルプ", bazMenu);
p.addNorth(menu, 24);

StackLayoutPanel sp = new StackLayoutPanel(Unit.EM);
sp.add(new HTML("<h1>this content</h1>"), new HTML("this"), 4);
sp.add(new HTML("that content"), new HTML("that"), 4);
sp.add(new HTML("the other content"), new HTML("the other"), 4);
p.addWest(sp, 200);

TabLayoutPanel tp = new TabLayoutPanel(1.5, Unit.EM);
tp.add(GetFrame("http://8.latest.webtestsample.appspot.com/"), "GWTサンプル");
tp.add(GetRichTextArea(), "that");
tp.add(new HTML("the other content"), "the other");
p.add(tp);

RootLayoutPanel rp = RootLayoutPanel.get();
rp.add(p);

0 件のコメント:

コメントを投稿

ホームページ