Widget asWidget() {
VerticalPanel layout = new VerticalPanel();
layout.addStyleName("window-content");
final DivertForm divertForm = new DivertForm(
new FormToolStrip.FormCallback<Divert>() {
@Override
public void onSave(Map<String, Object> changeset) {
}
@Override
public void onDelete(Divert entity) {
}
},false
);
divertForm.setQueueNames(queueNames);
divertForm.getForm().setNumColumns(1);
divertForm.setIsCreate(true);
layout.add(divertForm.asWidget());
DialogueOptions options = new DialogueOptions(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Form<Divert> form = divertForm.getForm();
FormValidation validation = form.validate();
if(!validation.hasErrors())
presenter.onCreateDivert(form.getUpdatedEntity());
}
},