use of org.pentaho.platform.dataaccess.datasource.ui.importing.MetadataImportDialogController 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