Search in sources :

Example 1 with WizardCallback

use of org.activityinfo.ui.client.widget.wizard.WizardCallback in project activityinfo by bedatadriven.

the class LayersWidget method createAddLayerButton.

private void createAddLayerButton() {
    Button addLayerButton = new Button();
    addLayerButton.setText(I18N.CONSTANTS.add());
    addLayerButton.addListener(Events.Select, new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            final NewLayerWizard wizard = new NewLayerWizard(service, locator);
            addLayersDialog = new WizardDialog(wizard);
            addLayersDialog.show(new WizardCallback() {

                @Override
                public void onFinished() {
                    addLayer(wizard.createLayer());
                }
            });
        }
    });
    addLayerButton.setIcon(IconImageBundle.ICONS.add());
    layersPanel.getHeader().addTool(addLayerButton);
}
Also used : WizardCallback(org.activityinfo.ui.client.widget.wizard.WizardCallback) Button(com.extjs.gxt.ui.client.widget.button.Button) WizardDialog(org.activityinfo.ui.client.widget.wizard.WizardDialog)

Example 2 with WizardCallback

use of org.activityinfo.ui.client.widget.wizard.WizardCallback in project activityinfo by bedatadriven.

the class MapTemplate method createElement.

@Override
public void createElement(final AsyncCallback<ReportElement> callback) {
    final NewLayerWizard wizard = new NewLayerWizard(dispatcher, locator);
    WizardDialog dialog = new WizardDialog(wizard);
    dialog.setHeadingText(I18N.CONSTANTS.newMap());
    dialog.show(new WizardCallback() {

        @Override
        public void onFinished() {
            MapReportElement map = new MapReportElement();
            map.addLayer(wizard.createLayer());
            callback.onSuccess(map);
        }
    });
}
Also used : NewLayerWizard(org.activityinfo.ui.client.component.report.editor.map.NewLayerWizard) MapReportElement(org.activityinfo.legacy.shared.reports.model.MapReportElement) WizardCallback(org.activityinfo.ui.client.widget.wizard.WizardCallback) WizardDialog(org.activityinfo.ui.client.widget.wizard.WizardDialog)

Aggregations

WizardCallback (org.activityinfo.ui.client.widget.wizard.WizardCallback)2 WizardDialog (org.activityinfo.ui.client.widget.wizard.WizardDialog)2 Button (com.extjs.gxt.ui.client.widget.button.Button)1 MapReportElement (org.activityinfo.legacy.shared.reports.model.MapReportElement)1 NewLayerWizard (org.activityinfo.ui.client.component.report.editor.map.NewLayerWizard)1