use of com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent in project pentaho-platform by pentaho.
the class ImportFileCommand method performOperation.
protected void performOperation(boolean feedback) {
// delete file
importDialog = new ImportDialog(repositoryFile, SolutionBrowserPanel.getInstance().isAdministrator());
importDialog.getForm().addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent sce) {
new RefreshRepositoryCommand().execute(false);
}
});
final IDialogCallback callback = new IDialogCallback() {
public void cancelPressed() {
importDialog.hide();
}
public void okPressed() {
importDialog.getForm().submit();
}
};
importDialog.setCallback(callback);
importDialog.center();
}
use of com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent 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);
}
}
Aggregations