use of org.pentaho.platform.dataaccess.datasource.modeler.ModelerDialog 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.platform.dataaccess.datasource.modeler.ModelerDialog 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);
}
});
}
});
}
Aggregations