use of com.sencha.gxt.widget.core.client.event.DialogHideEvent in project activityinfo by bedatadriven.
the class AnalysisView method ensureTitle.
private Promise<Void> ensureTitle() {
if (model.getWorking().isLoading()) {
return new Promise<>();
}
if (model.getWorking().get().getLabel().isPresent()) {
return Promise.done();
}
Promise<Void> result = new Promise<>();
PromptMessageBox box = new PromptMessageBox(I18N.CONSTANTS.save(), I18N.CONSTANTS.chooseReportTitle());
box.show();
box.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() {
@Override
public void onDialogHide(DialogHideEvent event) {
if (event.getHideButton() == Dialog.PredefinedButton.OK) {
AnalysisView.this.model.updateTitle(box.getTextField().getValue());
result.resolve(null);
}
}
});
return result;
}
Aggregations