Кто-нибудь, подскажите, как правильно использовать UIBinder и что не так с этим кодом: Код | package foo.client;
import com.extjs.gxt.ui.client.widget.Dialog; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel;
public class HW implements EntryPoint { public void onModuleLoad() { Dialog w = new Dialog(); w.setHeading("abc"); w.setSize(1000,600); w.setResizable(true); w.setButtons(""); w.setLayout(new FitLayout()); w.add(new TestUIBinder()); w.setPosition(10, 50); RootPanel.get().add(w); } }
|
Код | package foo.client;
import com.extjs.gxt.ui.client.widget.form.FieldSet; import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget;
public class TestUIBinder extends Composite {
private static TestUIBinderUiBinder uiBinder = GWT .create(TestUIBinderUiBinder.class);
interface TestUIBinderUiBinder extends UiBinder<Widget, TestUIBinder> { }
public TestUIBinder() { initWidget(uiBinder.createAndBindUi(this)); }
@UiField FieldSet fieldSet; }
|
TestUIBinder.ui.xml: Код | <!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" xmlns:gxt="urn:import:com.extjs.gxt.ui.client.widget" xmlns:gxt-form="urn:import:com.extjs.gxt.ui.client.widget.form" > <gxt-form:FieldSet ui:field="fieldSet" heading="x"> </gxt-form:FieldSet> </ui:UiBinder>
|
|