@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(!(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature()))); // setEnabled(!(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature()))); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(!(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature()))); // setEnabled(!(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature()))); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); setVisible(!(state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature()))); // setEnabled(!(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature()))); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature())); // setEnabled(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(!(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature()))); // setEnabled(!(model.isSlotArmed() // && aModel.feature.equals(model.getArmedFeature()))); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = QualifierFeatureEditor.this.stateModel.getObject(); setVisible(state.isSlotArmed() && QualifierFeatureEditor.this.getModelObject() .feature.equals(state.getArmedFeature())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); FeatureState featureState = LinkFeatureEditor.this.getModelObject(); if (state.isSlotArmed() && featureState.feature.equals(state.getArmedFeature())) { List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) featureState.value; setModelObject(links.get(state.getArmedSlot()).role); } else { setModelObject(""); } } });
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = LinkFeatureEditor.this.stateModel.getObject(); FeatureState featureState = LinkFeatureEditor.this.getModelObject(); if (state.isSlotArmed() && featureState.feature.equals(state.getArmedFeature())) { List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) featureState.value; setModelObject(links.get(state.getArmedSlot()).role); } else { setModelObject(""); } } });
@Override public void onConfigure(JQueryBehavior aBehavior) { super.onConfigure(aBehavior); aBehavior.setOption("placeholder", Options.asString("Select role")); // If a slot is armed, then load the slot's role into the dropdown AnnotatorState state = stateModel.getObject(); if (state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())) { List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) LinkFeatureEditor.this.getModelObject().value; setModelObject(links.get(state.getArmedSlot()).role); } else { setModelObject(""); } // Trigger a re-loading of the tagset from the server as constraints may have // changed the ordering Optional<AjaxRequestTarget> target = RequestCycle.get() .find(AjaxRequestTarget.class); if (target.isPresent()) { LOG.trace("onInitialize() requesting datasource re-reading"); target.get().appendJavaScript( String.format("var $w = %s; if ($w) { $w.dataSource.read(); }", KendoUIBehavior.widget(this, ComboBoxBehavior.METHOD))); } } };
@Override public void onConfigure(JQueryBehavior aBehavior) { super.onConfigure(aBehavior); aBehavior.setOption("placeholder", Options.asString("Select role")); // If a slot is armed, then load the slot's role into the dropdown AnnotatorState state = stateModel.getObject(); if (state.isSlotArmed() && LinkFeatureEditor.this.getModelObject().feature .equals(state.getArmedFeature())) { List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) LinkFeatureEditor.this.getModelObject().value; setModelObject(links.get(state.getArmedSlot()).role); } else { setModelObject(""); } // Trigger a re-loading of the tagset from the server as constraints may have // changed the ordering Optional<AjaxRequestTarget> target = RequestCycle.get() .find(AjaxRequestTarget.class); if (target.isPresent()) { LOG.trace("onInitialize() requesting datasource re-reading"); target.get().appendJavaScript( String.format("var $w = %s; if ($w) { $w.dataSource.read(); }", KendoUIBehavior.widget(this, ComboBoxBehavior.METHOD))); } } };
@SuppressWarnings("unchecked") private void setSlot(AjaxRequestTarget aTarget, JCas aJCas, int aAnnotationId) { AnnotatorState state = getModelObject(); // Set an armed slot if (!state.getSelection().isArc() && state.isSlotArmed()) { List<LinkWithRoleModel> links = (List<LinkWithRoleModel>) state.getFeatureState(state .getArmedFeature()).value; LinkWithRoleModel link = links.get(state.getArmedSlot()); link.targetAddr = aAnnotationId; link.label = selectByAddr(aJCas, aAnnotationId).getCoveredText(); } // Auto-commit if working on existing annotation if (state.getSelection().getAnnotation().isSet()) { try { actionCreateOrUpdate(aTarget, aJCas); } catch (Exception e) { handleException(this, aTarget, e); } } state.clearArmedSlot(); }
if (!state.isSlotArmed()) { throw new IllegalStateException("No slot is armed.");
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(); }
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(); }