VerticalLayoutContainer p=new VerticalLayoutContainer();
formPanel.add(p);
name=new TextField();
name.setAllowBlank(false);
p.add(new FieldLabel(name, "任务名称"),new VerticalLayoutData(1,-1));
ListStore<Map<String, String>> jobTypeStore=new ListStore<Map<String, String>>(new ModelKeyProvider<Map<String, String>>() {
public String getKey(Map<String, String> item) {
return item.get("name");
}
});
Map<String, String> javamain=new HashMap<String, String>();
javamain.put("name", JobModel.MapReduce);
jobTypeStore.add(javamain);
Map<String, String> shell=new HashMap<String, String>();
shell.put("name", JobModel.SHELL);
jobTypeStore.add(shell);
Map<String, String> hive=new HashMap<String, String>();
hive.put("name", JobModel.HIVE);
jobTypeStore.add(hive);
jobType=new ComboBox<Map<String, String>>(jobTypeStore,new LabelProvider<Map<String, String>>() {
public String getLabel(Map<String, String> item) {
return item.get("name");
}
});
jobType.setAllowBlank(false);
jobType.setTypeAhead(true);
jobType.setTriggerAction(TriggerAction.ALL);
jobType.setEditable(false);
jobType.setStore(jobTypeStore);
p.add(new FieldLabel(jobType, "任务类型"),new VerticalLayoutData(1, -1));
add(formPanel);
addButton(save);
}