【发布时间】:2013-08-23 17:14:25
【问题描述】:
首先,做这样的事情是个好习惯吗? 我尝试了对我来说似乎是正确的方法,但没有成功:
public class FormViewImpl extends CompositeView implements HasUiHandlers<C>, FormView {
public interface SettlementInstructionsSearchFormViewUiBinder extends UiBinder<Widget, SettlementInstructionsSearchFormViewImpl> {}
@Inject
static FormViewImpl uiBinder;
@Inject
static Provider<DateEditorWidget> dateEditorProvider;
@UiField(provided = true)
MyComponent<String> myComp;
@UiField
DateEditorWidget effectiveDateFrom;
// .. other fields
@Inject
public FormViewImpl () {
myComp = new MyComponent<String>("lol");
if (uiBinder == null)
uiBinder = GWT.create(SettlementInstructionsSearchFormViewUiBinder.class);
initWidget(uiBinder.createAndBindUi(this));
}
@UiFactory
DateEditorWidget createDateEditor() {
return dateEditorProvider.get();
}
}
除了没有参数的类之外还需要什么?在我公司的项目中,相同类型的代码在其他地方也可以使用。抱歉,这里的菜鸟水平很高... 如果各位大神指点一下就好了。
谢谢
【问题讨论】:
标签: gwt guice code-injection uibinder gwtp