use of de.tudarmstadt.ukp.clarin.webanno.brat.message.SpanAnnotationResponse in project webanno by webanno.
the class BratAnnotationEditor method actionSpan.
private SpanAnnotationResponse actionSpan(AjaxRequestTarget aTarget, IRequestParameters request, JCas jCas, VID paramId) throws IOException, AnnotationException {
Offsets offsets = getOffsetsFromRequest(request, jCas, paramId);
AnnotatorState state = getModelObject();
Selection selection = state.getSelection();
if (state.isSlotArmed()) {
// When filling a slot, the current selection is *NOT* changed. The
// Span annotation which owns the slot that is being filled remains
// selected!
getActionHandler().actionFillSlot(aTarget, jCas, offsets.getBegin(), offsets.getEnd(), paramId);
} else {
if (!paramId.isSynthetic()) {
selection.selectSpan(paramId, jCas, offsets.getBegin(), offsets.getEnd());
if (selection.getAnnotation().isNotSet()) {
// Create new annotation
getActionHandler().actionCreateOrUpdate(aTarget, jCas);
} else {
getActionHandler().actionSelect(aTarget, jCas);
}
}
}
return new SpanAnnotationResponse();
}
Aggregations