private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
private void actionGotoPage(AjaxRequestTarget aTarget, Form<?> aForm) throws Exception { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); List<Sentence> sentences = new ArrayList<>(select(editorCas, Sentence.class)); int selectedSentence = gotoPageTextField.getModelObject(); selectedSentence = Math.min(selectedSentence, sentences.size()); gotoPageTextField.setModelObject(selectedSentence); state.setFirstVisibleUnit(sentences.get(selectedSentence - 1)); state.setFocusUnitIndex(selectedSentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.add(gotoPageTextField); annotationEditor.requestRender(aTarget); }
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void actionRefreshDocument(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(getEditorCas()); curationContainer.setBratAnnotatorModel(state); update(aTarget); annotationEditor.requestRender(aTarget); } catch (Exception e) { handleException(aTarget, e); } } }
@Override protected void onChange(AjaxRequestTarget aTarget) { aTarget.addChildren(getPage(), IFeedback.class); aTarget.add(getOrCreatePositionInfoLabel()); try { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); //JCas correctionCas = repository.readCorrectionCas(state.getDocument()); annotationEditor.requestRender(aTarget); // info(bratAnnotatorModel.getMessage()); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); } catch (Exception e) { handleException(this, aTarget, e); } }
SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);
SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);
state.setFirstVisibleUnit(sentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);
state.setFirstVisibleUnit(sentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);
private void actionCompletePreferencesChange(AjaxRequestTarget aTarget) { try { AnnotatorState state = getModelObject(); JCas editorCas = getEditorCas(); // The number of visible sentences may have changed - let the state recalculate // the visible sentences Sentence sentence = selectByAddr(editorCas, Sentence.class, state.getFirstVisibleUnitAddress()); state.setFirstVisibleUnit(sentence); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); curationContainer = builder.buildCurationContainer(state); setCurationSegmentBeginEnd(editorCas); curationContainer.setBratAnnotatorModel(state); update(aTarget); aTarget.appendJavaScript( "Wicket.Window.unloadConfirmation = false;window.location.reload()"); // Re-render the whole page because the width of the sidebar may have changed aTarget.add(this); } catch (Exception e) { handleException(aTarget, e); } }
SuggestionBuilder cb = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);
SuggestionBuilder cb = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository); SuggestionBuilder builder = new SuggestionBuilder(casStorageService, documentService, correctionDocumentService, curationDocumentService, annotationService, userRepository);