use of org.pentaho.ui.xul.gwt.util.AsyncConstructorListener in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showAnalysisImportDialog.
public void showAnalysisImportDialog(final DialogListener listener) {
final DialogListener<AnalysisImportDialogModel> importDialoglistener = new DialogListener<AnalysisImportDialogModel>() {
public void onDialogCancel() {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final AnalysisImportDialogModel importDialogModel) {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
analysisDataFormPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
String results = event.getResults();
String message = controller.convertToNLSMessage(results, controller.getFileName());
if (!SUCCESS_3.equals(results)) {
if (OVERWRITE_8.equals(results) || OVERWRITE__CATALOG_7.equals(results)) {
overwriteFileDialog(analysisDataFormPanel, message, controller);
} else {
listener.onDialogError(message);
}
} else {
analysisDataFormPanel.removeFromParent();
listener.onDialogAccept(null);
}
}
});
analysisDataFormPanel.submit();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showAnalysisImportDialog(importDialoglistener);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showAnalysisImportDialog(importDialoglistener);
}
}
use of org.pentaho.ui.xul.gwt.util.AsyncConstructorListener in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showWizardEdit.
public void showWizardEdit(final String domainId, final String modelId, final String perspective, boolean reportingOnlyValid, final DialogListener<Domain> listener) {
final String modelPerspective;
if (perspective == null) {
modelPerspective = ModelerPerspective.ANALYSIS.name();
} else {
modelPerspective = perspective;
}
modeler = ModelerDialog.getInstance(wizard, new AsyncConstructorListener<ModelerDialog>() {
public void asyncConstructorDone(ModelerDialog dialog) {
ModelerPerspective modelerPerspective;
try {
modelerPerspective = ModelerPerspective.valueOf(modelPerspective);
} catch (IllegalArgumentException e) {
modelerPerspective = ModelerPerspective.ANALYSIS;
}
dialog.addDialogListener(listener);
dialog.showDialog(domainId, modelId, modelerPerspective);
}
});
}
use of org.pentaho.ui.xul.gwt.util.AsyncConstructorListener in project data-access by pentaho.
the class EmbeddedWizard method showModelEditor.
@Bindable
public void showModelEditor() {
// open up the modeler
final DialogListener<Domain> listener = new DialogListener<Domain>() {
public void onDialogCancel() {
EmbeddedWizard.this.onDialogAccept();
wizardController.resetSelectedDatasource();
}
public void onDialogAccept(final Domain domain) {
EmbeddedWizard.this.onDialogAccept();
wizardController.resetSelectedDatasource();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
wizardController.resetSelectedDatasource();
}
};
final String domainId = summary.getDomain().getId();
final EmbeddedWizard wizard = this;
// reload model for synchronize between GWT model and backend model http://jira.pentaho.com/browse/BISERVER-10399
GwtModelerServiceImpl ssd = new GwtModelerServiceImpl();
ssd.loadDomain(domainId, new XulServiceCallback<Domain>() {
@Override
public void error(String arg0, Throwable arg1) {
// js console log
arg1.printStackTrace();
wizardController.resetSelectedDatasource();
MessageHandler.getInstance().closeWaitingDialog();
// user error dialog
MessageHandler.getInstance().showErrorDialog(// $NON-NLS-1$
datasourceMessages.getString("DatasourceEditor.ERROR"), // $NON-NLS-1$ );
datasourceMessages.getString("DatasourceEditor.ERROR_0002_UNABLE_TO_SHOW_DIALOG", arg1.getLocalizedMessage()));
}
@Override
public void success(Domain arg0) {
summary.setDomain(arg0);
final Domain domain = summary.getDomain();
ModelerDialog.getInstance(wizard, new AsyncConstructorListener<ModelerDialog>() {
public void asyncConstructorDone(ModelerDialog dialog) {
dialog.addDialogListener(listener);
MessageHandler.getInstance().closeWaitingDialog();
dialog.showDialog(domain);
}
});
}
});
}
use of org.pentaho.ui.xul.gwt.util.AsyncConstructorListener in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showEditAnalysisDialog.
public void showEditAnalysisDialog(final DialogListener listener, final IDatasourceInfo datasourceInfo) {
final DialogListener<AnalysisImportDialogModel> importDialoglistener = new DialogListener<AnalysisImportDialogModel>() {
public void onDialogCancel() {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final AnalysisImportDialogModel importDialogModel) {
final AnalysisImportDialogController controller = importDialog.getAnalysisImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters(true);
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
analysisDataFormPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
String results = event.getResults();
String message = controller.convertToNLSMessage(results, controller.getFileName());
if (!SUCCESS_3.equals(results)) {
if (OVERWRITE_8.equals(results) || OVERWRITE__CATALOG_7.equals(results)) {
overwriteFileDialog(analysisDataFormPanel, message, controller);
} else {
listener.onDialogError(message);
}
} else {
analysisDataFormPanel.removeFromParent();
listener.onDialogAccept(null);
}
}
});
analysisDataFormPanel.submit();
}
public void onDialogReady() {
}
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showAnalysisImportDialog(importDialoglistener, datasourceInfo);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showAnalysisImportDialog(importDialoglistener, datasourceInfo);
}
}
use of org.pentaho.ui.xul.gwt.util.AsyncConstructorListener in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showMetadataImportDialog.
public void showMetadataImportDialog(final DialogListener listener) {
final DialogListener<MetadataImportDialogModel> importDialoglistener = new DialogListener<MetadataImportDialogModel>() {
public void onDialogCancel() {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final MetadataImportDialogModel importDialogModel) {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel metaDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
metaDataFormPanel.removeFromParent();
RootPanel.get().add(metaDataFormPanel);
controller.setImportCompleteCallback(new MetadataImportDialogController.ImportCompleteCallback() {
@Override
public void onImportSuccess() {
listener.onDialogAccept(null);
}
@Override
public void onImportCancel() {
listener.onDialogCancel();
}
});
metaDataFormPanel.submit();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showMetadataImportDialog(importDialoglistener);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showMetadataImportDialog(importDialoglistener);
}
}
Aggregations