<!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>
</ui:style>
<g:HTMLPanel>
<g:HorizontalPanel spacing="10">
<g:Button ui:field="button">Normal Button</g:Button>
<g:Button enabled="false">Disabled Button</g:Button>
</g:HorizontalPanel>
</g:HTMLPanel>
</ui:UiBinder>
package yanzm.example.hellowtgt.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
public class BasicButton extends Composite {
private static BasicButtonUiBinder uiBinder = GWT
.create(BasicButtonUiBinder.class);
interface BasicButtonUiBinder extends UiBinder<Widget, BasicButton> {
}
@UiField
public Button button;
public BasicButton() {
initWidget(uiBinder.createAndBindUi(this));
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Clicked!");
}
});
}
}
■ その他
・Java code による実装例 (Showcase)
・com.google.gwt.user.client.ui.Button
0 件のコメント:
コメントを投稿