final Form<WorkmanagerPool> form = new Form(WorkmanagerPool.class);
TextBoxItem nameField = new TextBoxItem("name", Console.CONSTANTS.common_label_name());
final ComboBoxItem type = new ComboBoxItem("type", "Type");
type.setDefaultToFirstOption(true);
type.setValueMap(new String[] {"long-running"});
NumberBoxItem maxThreads = new NumberBoxItem("maxThreadsCount", "Max Threads");
NumberBoxItem maxThreadsPerCPU = new NumberBoxItem("maxThreadsPerCPU", "Max Threads/CPU");
NumberBoxItem queueLength = new NumberBoxItem("queueLengthCount", "Queue Length");
NumberBoxItem queueLengthPerCPU = new NumberBoxItem("queueLengthPerCPU", "Queue Length/CPU");
maxThreads.setValue(10);
maxThreadsPerCPU.setValue(20);
queueLength.setValue(10);
queueLengthPerCPU.setValue(20);
form.setFields(nameField, type, maxThreads, maxThreadsPerCPU, queueLength, queueLengthPerCPU);
DialogueOptions options = new DialogueOptions(
// save
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkmanagerPool pool = form.getUpdatedEntity();
pool.setShortRunning(type.getValue().equals("short-running"));
FormValidation validation = form.validate();
if(validation.hasErrors())
return;