/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void delete(AnnotatorState aState, JCas aJCas, VID aVid) { delete(aState.getDocument(), aState.getUser().getUsername(), aJCas, aVid); }
/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void delete(AnnotatorState aState, JCas aJCas, VID aVid) { delete(aState.getDocument(), aState.getUser().getUsername(), aJCas, aVid); }
private void actionDelete(AjaxRequestTarget aTarget) { try { // Load the boiler-plate JCas jCas = jcasProvider.get(); AnnotationBaseFS fs = selectByAddr(jCas, AnnotationBaseFS.class, getModelObject().getId()); AnnotationLayer layer = annotationService.getLayer(project.getObject(), fs); TypeAdapter adapter = annotationService.getAdapter(layer); // Perform actual actions adapter.delete(sourceDocument.getObject(), username.getObject(), jCas, new VID(fs)); // persist changes annotationPage.writeEditorCas(jCas); setModelObject(null); aTarget.add(getParent()); } catch (Exception e) { handleException(DocumentMetadataAnnotationDetailPanel.this, aTarget, e); } }
private void actionDelete(AjaxRequestTarget aTarget) { try { // Load the boiler-plate JCas jCas = jcasProvider.get(); AnnotationBaseFS fs = selectByAddr(jCas, AnnotationBaseFS.class, getModelObject().getId()); AnnotationLayer layer = annotationService.getLayer(project.getObject(), fs); TypeAdapter adapter = annotationService.getAdapter(layer); // Perform actual actions adapter.delete(sourceDocument.getObject(), username.getObject(), jCas, new VID(fs)); // persist changes annotationPage.writeEditorCas(jCas); setModelObject(null); aTarget.add(getParent()); } catch (Exception e) { handleException(DocumentMetadataAnnotationDetailPanel.this, aTarget, e); } }
@Deprecated private static void deleteSpanAnnotation(TypeAdapter aAdapter, AnnotatorState aState, JCas aJCas, AnnotationFeature aFeature, int aBegin, int aEnd, Object aValue) { Type type = CasUtil.getType(aJCas.getCas(), aAdapter.getAnnotationTypeName()); for (AnnotationFS fs : CasUtil.selectCovered(aJCas.getCas(), type, aBegin, aEnd)) { if (fs.getBegin() == aBegin && fs.getEnd() == aEnd) { if (ObjectUtils.equals(aAdapter.getFeatureValue(aFeature, fs), aValue)) { aAdapter.delete(aState.getDocument(), aState.getUser().getUsername(), aJCas, new VID(getAddr(fs))); } } } }
@Deprecated private static void deleteSpanAnnotation(TypeAdapter aAdapter, AnnotatorState aState, JCas aJCas, AnnotationFeature aFeature, int aBegin, int aEnd, Object aValue) { Type type = CasUtil.getType(aJCas.getCas(), aAdapter.getAnnotationTypeName()); for (AnnotationFS fs : CasUtil.selectCovered(aJCas.getCas(), type, aBegin, aEnd)) { if (fs.getBegin() == aBegin && fs.getEnd() == aEnd) { if (ObjectUtils.equals(aAdapter.getFeatureValue(aFeature, fs), aValue)) { aAdapter.delete(aState.getDocument(), aState.getUser().getUsername(), aJCas, new VID(getAddr(fs))); } } } }
adapter.delete(state, jCas, state.getSelection().getAnnotation());