use of com.vaadin.ui.Grid.ItemClick in project catma by forTEXT.
the class KwicPanel method handleKwicItemClick.
private void handleKwicItemClick(ItemClick<QueryResultRow> clickEvent, EventBus eventBus) {
if (clickEvent.getMouseEventDetails().isDoubleClick()) {
QueryResultRow selectedRow = clickEvent.getItem();
final String documentId = selectedRow.getSourceDocumentId();
List<QueryResultRow> documentRows = kwicDataProvider.getItems().parallelStream().filter(row -> row.getSourceDocumentId().equals(documentId)).collect(Collectors.toList());
try {
if (project.hasDocument(documentId)) {
eventBus.post(new QueryResultRowInAnnotateEvent(documentId, selectedRow, documentRows, project));
} else {
Notification.show("Info", "The corresponding Document is no longer part of the Project!", Type.WARNING_MESSAGE);
}
} catch (Exception e) {
((ErrorHandler) UI.getCurrent()).showAndLogError("error accessing project data", e);
}
}
}
Aggregations