Search in sources :

Example 1 with PromptMessageBox

use of com.sencha.gxt.widget.core.client.box.PromptMessageBox 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;
}
Also used : Promise(org.activityinfo.promise.Promise) DialogHideEvent(com.sencha.gxt.widget.core.client.event.DialogHideEvent) PromptMessageBox(com.sencha.gxt.widget.core.client.box.PromptMessageBox)

Example 2 with PromptMessageBox

use of com.sencha.gxt.widget.core.client.box.PromptMessageBox in project activityinfo by bedatadriven.

the class DimensionPane method editTotalLabel.

private void editTotalLabel(EffectiveDimension dim) {
    PromptMessageBox messageBox = new PromptMessageBox("Update total label:", "Enter the new label");
    messageBox.getTextField().setText(dim.getTotalLabel());
    messageBox.addDialogHideHandler(event -> {
        if (event.getHideButton() == Dialog.PredefinedButton.OK) {
            updateTotalLabel(dim, messageBox.getValue());
        }
    });
    messageBox.show();
}
Also used : PromptMessageBox(com.sencha.gxt.widget.core.client.box.PromptMessageBox)

Example 3 with PromptMessageBox

use of com.sencha.gxt.widget.core.client.box.PromptMessageBox in project activityinfo by bedatadriven.

the class DimensionPane method editLabel.

private void editLabel(DimensionModel dim) {
    PromptMessageBox messageBox = new PromptMessageBox("Update dimension's label:", "Enter the new label");
    messageBox.getTextField().setText(dim.getLabel());
    messageBox.addDialogHideHandler(event -> {
        if (event.getHideButton() == Dialog.PredefinedButton.OK) {
            updateLabel(dim, messageBox.getValue());
        }
    });
    messageBox.show();
}
Also used : PromptMessageBox(com.sencha.gxt.widget.core.client.box.PromptMessageBox)

Example 4 with PromptMessageBox

use of com.sencha.gxt.widget.core.client.box.PromptMessageBox in project activityinfo by bedatadriven.

the class MeasurePane method editLabel.

private void editLabel(MeasureModel measure) {
    PromptMessageBox messageBox = new PromptMessageBox("Update measure's alias:", "Enter the new alias");
    messageBox.getTextField().setText(measure.getLabel());
    messageBox.addDialogHideHandler(event -> {
        if (event.getHideButton() == Dialog.PredefinedButton.OK) {
            updateMeasureLabel(measure, messageBox.getValue());
        }
    });
    messageBox.show();
}
Also used : PromptMessageBox(com.sencha.gxt.widget.core.client.box.PromptMessageBox)

Aggregations

PromptMessageBox (com.sencha.gxt.widget.core.client.box.PromptMessageBox)4 DialogHideEvent (com.sencha.gxt.widget.core.client.event.DialogHideEvent)1 Promise (org.activityinfo.promise.Promise)1