}
protected void doAddNewEntity() {
final PropertyHaverEditor2<T> entityEditor = new PropertyHaverEditor2<T>(y);
final Panel panel = y.newPanel((PanelConfig) PanelConfig.create().centered(true).width("400px"));
panel.headerContent("<h1>Add new " + entityName + "</h1>");
panel.bodyContent("<div class=\"bodyContent\"></div>");
panel.footerContent("<i>small</i>");
Button cancelButton = y.newButton(ButtonConfig.create().label("Cancel").on("click", new EventCallback<ButtonEvent>() {
@Override
public void call(ButtonEvent e) {
panel.hide();
panel.contentBox().remove();
}
})).render().cast();
panel.addButton(cancelButton);
Button acceptButton = y.newButton(ButtonConfig.create().label("Accept").on("click", new EventCallback<ButtonEvent>() {
@Override
public void call(ButtonEvent e) {
T edited = entityEditor.flush();
all.add(edited);
notifyAllChange();
// Person1 editedPerson = (Person1) edited;
// Window.alert("edited person name : "+editedPerson.getName());
panel.hide();
panel.contentBox().remove();
}
})).render().cast();
panel.addButton(acceptButton);
panel.render(y.one("body"));
Node bodyNode2 = panel.srcNode().one(".bodyContent");
entityEditor.render(bodyNode2);
entityEditor.load(sampleEntity);
}