use of de.catma.ui.events.routing.RouteToAnnotateEvent in project catma by forTEXT.
the class ProjectView method handleResourceItemClick.
private void handleResourceItemClick(ItemClick<Resource> itemClickEvent) {
if (itemClickEvent.getMouseEventDetails().isDoubleClick()) {
Resource resource = itemClickEvent.getItem();
@SuppressWarnings("unchecked") TreeDataProvider<Resource> resourceDataProvider = (TreeDataProvider<Resource>) documentGrid.getDataProvider();
Resource root = resourceDataProvider.getTreeData().getParent(resource);
Resource child = null;
if (root == null) {
root = resource;
} else {
child = resource;
}
if (root != null) {
SourceDocument document = ((DocumentResource) root).getDocument();
AnnotationCollectionReference collectionReference = (child == null ? null : ((CollectionResource) child).getCollectionReference());
eventBus.post(new RouteToAnnotateEvent(project, document, collectionReference));
}
}
}
Aggregations