use of de.catma.ui.module.analyze.visualization.kwic.annotation.AnnotationWizard in project catma by forTEXT.
the class KwicPanel method handleAnnotateSelectedRequest.
private void handleAnnotateSelectedRequest(EventBus eventBus) {
final Set<QueryResultRow> selectedRows = kwicGrid.getSelectedItems();
if (selectedRows.isEmpty()) {
Notification.show("Info", "Please select one or more rows to annotate!", Type.HUMANIZED_MESSAGE);
return;
}
Set<String> documentIds = kwicDataProvider.getItems().stream().map(row -> row.getSourceDocumentId()).collect(Collectors.toSet());
WizardContext wizardContext = new WizardContext();
wizardContext.put(AnnotationWizardContextKey.DOCUMENTIDS, documentIds);
AnnotationWizard wizard = new AnnotationWizard(eventBus, project, wizardContext, new SaveCancelListener<WizardContext>() {
@Override
public void savePressed(WizardContext result) {
try {
annotateSelection(selectedRows, result);
} catch (Exception e) {
((ErrorHandler) UI.getCurrent()).showAndLogError("error annotating selected rows", e);
}
}
});
wizard.show();
}
Aggregations