Tag: gwt editors

Gwt编辑器不仅具有getter / setter bean类

假设我在GWT中有表单构建,这是一个UI-Binder,它实现了编辑器界面(com.google.gwt.editor.client.Editor),其中包含两个日期字段(日期来自和来)。 Bean类应该有成员: 日期来自日期; //用getter和setter 日期至日期; //用getter和setter 好吧,虽然将bean类定义为已编写,但没有问题,但在我添加这样的内容之后: public boolean hasFromDate() { return fromDate != null; } 我收到了编译错误(例如fromDate): [ERROR] Line 17: The method hasFromDate() is undefined for the type Date [ERROR] Line 20: The method setFromDate(Date) is undefined for the type Date 临时文件中生成的代码(qualifiedBeanClass_fromDate_Context.java)似乎具有: @Override public java.util.Date getFromModel() { return (parent != null && true) ? parent.getToDate().hasToDate() […]

GWT Editors框架 – ListEditor,删除项目,MVP违规

public class PersonListEditor extends Composite implements IsEditor<ListEditor> { private static PersonListEditorUiBinder uiBinder = GWT.create(PersonListEditorUiBinder.class); interface PersonListEditorUiBinder extends UiBinder {} private class Source extends EditorSource { @Override public PersonListItemWidget create(int index) { PersonListItemWidget widget = new PersonListItemWidget(); panel.insert(widget, index); return widget; } } @UiField VerticalPanel panel; private ListEditor editor = ListEditor.of(new Source()); public PersonListEditor() { initWidget(uiBinder.createAndBindUi(this)); […]

如何为类型的子类实现GWT编辑器?

假设我有一个像这样的对象层次结构: 帐户>网站>供应 账户是一个实际的公司,一个网站是他们拥有的建筑,而一个供应是ElecSupply或GasSupply 。 供应从未实例化,理论上可能是一个抽象的阶级。 我使用Objectify进行持久化,并有一个页面显示每个站点的供应列表,无论它们是ElecSupply还是GasSupply 。 现在我正在实现GWT编辑器框架 ,并遇到了这个多态实体的问题。 如何为这样的对象实现编辑器和子编辑器集? @Entity public class Supply implements Serializable { @Id protected Long id; @Embedded protected List billingPeriods = new ArrayList(); public Supply() { } // … } 子类:( ElecSupply有5个独特的字段,GasSupply只有一个) @Subclass public class ElecSupply extends Supply implements Serializable { private String profile; private String mtc; private String llf; […]