2011年4月1日金曜日

GWT UiBinder で CheckBox を使う




<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.my-CheckBox {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel>
<g:VerticalPanel>
<g:CheckBox value="true">Monday</g:CheckBox>
<g:CheckBox focus="true">Tuesday</g:CheckBox>
<g:CheckBox styleName="{style.my-CheckBox}">Wednesday</g:CheckBox>
<g:CheckBox>Thursday</g:CheckBox>
<g:CheckBox>Friday</g:CheckBox>
<g:CheckBox enabled="false">Saturday</g:CheckBox>
<g:CheckBox enabled="false">Sunday</g:CheckBox>
</g:VerticalPanel>
<g:VerticalPanel width="50px">
<g:CheckBox text="January,February, March, April" />
<g:CheckBox wordWrap="true">May, June, July, August</g:CheckBox>
</g:VerticalPanel>
</g:HTMLPanel>
</ui:UiBinder>



package yanzm.example.hellowtgt.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class CheckBox extends Composite {

private static CheckBoxUiBinder uiBinder = GWT
.create(CheckBoxUiBinder.class);

interface CheckBoxUiBinder extends UiBinder<Widget, CheckBox> {
}

public CheckBox() {
initWidget(uiBinder.createAndBindUi(this));
}
}





■ その他
Java code による実装例 (Showcase)
com.google.gwt.user.client.ui.CheckBox

 

0 件のコメント:

コメントを投稿