@Override
public void onShowCustomColumnDescriptorForm(final ShowCustomColumnDescriptorFormEvent event) {
final FormView formView = new DefaultFormView("AddCustomColumnDescriptorForm");
final FormConfiguration formConfiguration = new FormConfiguration();
formConfiguration.setName("Form");
final AddCustomColumnDescriptorForm form = new AddCustomColumnDescriptorForm(formConfiguration, formView, complexListConfiguration.getClas(), ComplexListActivity.this);
final PSimplePanel windowContent = new PSimplePanel();
form.start(windowContent);
PConfirmDialog.show("Add custom column", windowContent, "Ok", "Cancel", new PConfirmDialogHandler() {
@Override
public boolean onOK(final PDialogBox dialogBox) {
if (form.isValid()) {
final Class<?> fieldType = form.getFieldType();
final String fieldPath = form.getFieldPath();
final String caption = form.getCaption();
onAddCustomColumnDescriptor(new AddCustomColumnDescriptorEvent(ComplexListActivity.this, new ColumnDescriptorFieldHolder(caption, fieldPath, fieldType, complexListConfiguration.getTableName())));
eventBus.fireEvent(new PreferenceChangedEvent(ComplexListActivity.this));
return true;
}
return false;