SearchBean searchBean = new SearchBean();
FormModel formModel = FormModelHelper.createFormModel(searchBean);
final SearchForm form = new SearchForm(formModel);
FormBackedDialogPage page = new FormBackedDialogPage(form);
TitledPageApplicationDialog dialog =
new TitledPageApplicationDialog(page, getParentWindowControl()) {
protected boolean onFinish() {
form.commit();
SearchBean bean = (SearchBean)form.getFormObject();
try{
SearchWorker worker = new SearchWorker(bean.getQueryString());
worker.start();
return true;
}
catch(IllegalArgumentException e){
return false;
}
}
};
dialog.showDialog();
}