private static void setInPlaceEditingOfRecentlyAddedNodes(CompilationUnitEditor targetCompilationUnitEditor)
      throws ExecutionException {

    ASTNode typeNode = getTypeNode(targetCompilationUnitEditor);

    // Find our nodes again.
    Result stuff = findAllConstructorsAndFields(typeNode);

    final List<ASTNode> types = new ArrayList<ASTNode>();
    final List<ASTNode> names = new ArrayList<ASTNode>();

    // Member variable find
    FieldDeclaration field = stuff.field;
    ASTVisitor fieldVisitor = new ASTVisitor() {
      @Override
      public boolean visit(SimpleType node) {
        types.add(node);
        return false;
      }

      @Override
      public boolean visit(VariableDeclarationFragment node) {
        names.add(node);
        return false;
      }
    };
    field.accept(fieldVisitor);

    // Constructor parameter find
    for (MethodDeclaration constructor : stuff.constructors) {
      @SuppressWarnings("unchecked")
      List<SingleVariableDeclaration> parameters = constructor.parameters();
      SingleVariableDeclaration param = parameters.get(0);
      ASTVisitor parameterVisitor = new ASTVisitor() {
        @Override
        public boolean visit(SingleVariableDeclaration node) {
          names.add(node.getName());
          types.add(node.getType());
          return false;
        }
      };
      param.accept(parameterVisitor);
    }
    for (MethodDeclaration constructor : stuff.constructors) {

      // Body find
      final List<Assignment> assignments = new ArrayList<Assignment>();
      ASTVisitor bodyVisitor = new ASTVisitor() {
        @Override
        public boolean visit(Assignment node) {
          assignments.add(node);
          return false;
        }
      };
      Block body = constructor.getBody();
      body.accept(bodyVisitor);
      ASTVisitor assignmentVisitor = new ASTVisitor() {
        @Override
        public boolean visit(SimpleName node) {
          names.add(node);
          return false;
        }
      };
      assignments.get(0).accept(assignmentVisitor);
    }

    try {
      // Set up linking between edit boxes
      IDocument document =
          JavaUI.getDocumentProvider().getDocument(
              targetCompilationUnitEditor.getEditorInput());
      LinkedPositionGroup typesGroup = new LinkedPositionGroup();
      for (int i = 0; i < types.size(); i++) {
        ASTNode elem = types.get(i);
        typesGroup.addPosition(new LinkedPosition(document, elem
            .getStartPosition(), elem.getLength(), i));
      }
      LinkedPositionGroup namesGroup = new LinkedPositionGroup();
      for (int i = 0; i < names.size(); i++) {
        ASTNode elem = names.get(i);
        namesGroup.addPosition(new LinkedPosition(document, elem
            .getStartPosition(), elem.getLength(), i));
      }
      LinkedModeModel model = new LinkedModeModel();
      model.addGroup(typesGroup);
      model.addGroup(namesGroup);
      model.forceInstall();
      model.addLinkingListener(new EditorHighlightingSynchronizer(
          targetCompilationUnitEditor));
      ITextViewer viewer = targetCompilationUnitEditor.getViewer();
  
      Point selection = viewer.getSelectedRange();
      LinkedModeUI ui = new EditorLinkedModeUI(model, viewer);
      ui.setExitPolicy(new DeleteBlockingExitPolicy(document));
      Point selectedRange = getPosition(targetCompilationUnitEditor);
      ui.setExitPosition(viewer, selectedRange.x, selectedRange.y,
          Integer.MAX_VALUE);
      ui.enter();
    } catch (BadLocationException e) {
      throw new ExecutionException(
          "Error accessing cursor location in document", e);
    }
  }