private Dataflow createNestedDataflow(ActionEvent e) { Dataflow nestedDataflow = edits.createDataflow(); ((DataflowImpl) nestedDataflow).setLocalName(nameField.getText()); try { AnnotationTools at = new AnnotationTools(); at.setAnnotationString(nestedDataflow, DescriptiveTitle.class, nameField.getText()).doEdit(); } catch (EditException e2) { logger.error("failed to put annotation on nested dataflow", e2); } return nestedDataflow; }
private Processor createNestingProcessor(List<Edit<?>> editList) { Processor nestingProcessor = edits.createProcessor(uniqueProcessorName( nameField.getText(), currentDataflow)); if (includedProcessors.size() != 1 || !(includedProcessors.get(0) instanceof Processor)) return nestingProcessor; Processor includedProcessor = (Processor) includedProcessors.get(0); for (Class<?> c : at.getAnnotatingClasses(includedProcessor)) { AnnotationBeanSPI annotation = at.getAnnotation(includedProcessor, AbstractTextualValueAssertion.class); if ((annotation != null) && (annotation instanceof AbstractTextualValueAssertion)) editList.add(at.setAnnotationString(nestingProcessor, c, ((AbstractTextualValueAssertion) annotation).getText())); } return nestingProcessor; }
public void focusLost(FocusEvent e) { String currentValue = area.getText(); if (currentValue.equals("") || currentValue.equals(MISSING_VALUE)) { currentValue = MISSING_VALUE; area.setText(currentValue); } if (!currentValue.equals(oldValue)) { if (currentValue == MISSING_VALUE) { currentValue = ""; } try { Edits edits = EditsRegistry.getEdits(); Dataflow currentDataflow = fileManager.getCurrentDataflow(); List<Edit<?>> editList = new ArrayList<Edit<?>>(); editList.add(annotationTools.setAnnotationString(annotated, annotationClass, currentValue)); if ((annotated == currentDataflow) && (prb.getString(annotationClass.getCanonicalName()).equals("Title")) &&!currentValue.isEmpty()) { editList.add(edits.getUpdateDataflowNameEdit(currentDataflow, sanitiseName(currentValue))); } if (!isStandalone) { ContextualViewComponent.selfGenerated = true; } editManager.doDataflowEdit(currentDataflow, new CompoundEdit(editList)); ContextualViewComponent.selfGenerated = false; } catch (EditException e1) { logger.warn("Can't set annotation", e1); } oldValue = area.getText(); } }
continue; try { aTools.setAnnotationString(this, c, annotationValue) .doEdit(); } catch (EditException e) {