use of de.catma.ui.module.project.corpusimport.CorpusImportDocumentMetadata in project catma by forTEXT.
the class ProjectView method handleCorpusImport.
private void handleCorpusImport() {
try {
if (project.hasUncommittedChanges()) {
SingleTextInputDialog dlg = new SingleTextInputDialog("Commit all changes", "You have changes, that need to be committed first, please enter a short description for this commit:", commitMsg -> {
try {
project.commitChanges(commitMsg);
importCollection();
} catch (Exception e) {
setEnabled(true);
((ErrorHandler) UI.getCurrent()).showAndLogError("error committing changes", e);
}
});
dlg.show();
} else {
CorpusImportDialog corpusImportDialog = new CorpusImportDialog(new SaveCancelListener<Pair<File, List<CorpusImportDocumentMetadata>>>() {
@Override
public void savePressed(Pair<File, List<CorpusImportDocumentMetadata>> result) {
importCorpus(result.getFirst(), result.getSecond());
}
});
corpusImportDialog.show();
}
} catch (Exception e) {
errorHandler.showAndLogError("Error accessing Project!", e);
}
}
Aggregations