Package org.eclipse.text.edits

Examples of org.eclipse.text.edits.TextEdit.addChild()


        if (initialIndentationLevel > 0) {
            // at least correct the indent
            String indentString = createIndentString(initialIndentationLevel);
        ReplaceEdit[] edits = IndentManipulation.getChangeIndentEdits(unformatted, 0, this.tabWidth, this.indentWidth, indentString);
        edit= new MultiTextEdit();
        edit.addChild(new InsertEdit(0, indentString));
        edit.addChildren(edits);
        } else {
           return unformatted;
        }
    }
View Full Code Here


                    /* match end boundary */"(" + grammarSeparator + "|" + Pattern.quote(".*") + "|" + Pattern.quote("\\") + "|$)");

                    /* find all matches to replace and add them to the root edit */
                    Matcher matcher = pattern.matcher(bndFileText);
                    while (matcher.find()) {
                        rootEdit.addChild(new ReplaceEdit(matcher.start(2), matcher.group(2).length(), newName));
                    }

                    pattern = Pattern.compile(
                    /* match start boundary */"(^|" + grammarSeparator + ")" +
                    /* match bundle activator */"(Bundle-Activator\\s*:\\s*)" +
View Full Code Here

                    /* match end boundary */"(" + grammarSeparator + "|" + Pattern.quote("\\") + "|$)");

                    /* find all matches to replace and add them to the root edit */
                    matcher = pattern.matcher(bndFileText);
                    while (matcher.find()) {
                        rootEdit.addChild(new ReplaceEdit(matcher.start(3), matcher.group(3).length(), newName));
                    }
                }

                /*
                 * only store the changes when no changes were stored before for this file and when there are actually
View Full Code Here

    if (root == null) {
      root = new MultiTextEdit();
      change.setEdit(root);
    }

    root.addChild(edit);
    change.addTextEditGroup(new TextEditGroup(name, edit));
  }

  @Override
  protected String[] getAffectedProjectNatures() throws CoreException {
View Full Code Here

        final int addedLength = addedEnd - addedStart + 1;
        final int deletedLength = deletedEnd - deletedStart + 1;
        final int minLength = Math.min(addedLength, deletedLength);

        if (deletedLength < addedLength) {
            result.addChild(new InsertEdit(deletedStart + minLength, getString(addedStart
                    + minLength, addedEnd)));
        }

        result.addChild(new ReplaceEdit(deletedStart, minLength, getString(addedStart,
                addedStart + minLength - 1)));
View Full Code Here

        if (deletedLength < addedLength) {
            result.addChild(new InsertEdit(deletedStart + minLength, getString(addedStart
                    + minLength, addedEnd)));
        }

        result.addChild(new ReplaceEdit(deletedStart, minLength, getString(addedStart,
                addedStart + minLength - 1)));

        if (addedLength < deletedLength) {
            result.addChild(new DeleteEdit(deletedStart + minLength, deletedLength
                    - minLength));
View Full Code Here

        result.addChild(new ReplaceEdit(deletedStart, minLength, getString(addedStart,
                addedStart + minLength - 1)));

        if (addedLength < deletedLength) {
            result.addChild(new DeleteEdit(deletedStart + minLength, deletedLength
                    - minLength));
        }

        return result;
    }
View Full Code Here

          continue;
        }
        if (rootEdit == null) {
          rootEdit = new MultiTextEdit();
        }
        rootEdit.addChild(new DeleteEdit(charPos, lineEnd - charPos));
      }
    }
    return rootEdit;
  }
View Full Code Here

        if (initialIndentationLevel > 0) {
            // at least correct the indent
            String indentString = createIndentString(initialIndentationLevel);
        ReplaceEdit[] edits = IndentManipulation.getChangeIndentEdits(unformatted, 0, this.tabWidth, this.indentWidth, indentString);
        edit= new MultiTextEdit();
        edit.addChild(new InsertEdit(0, indentString));
        edit.addChildren(edits);
        } else {
           return unformatted;
        }
    }
View Full Code Here

        if (initialIndentationLevel > 0) {
            // at least correct the indent
            String indentString = createIndentString(initialIndentationLevel);
        ReplaceEdit[] edits = IndentManipulation.getChangeIndentEdits(unformatted, 0, this.tabWidth, this.indentWidth, indentString);
        edit= new MultiTextEdit();
        edit.addChild(new InsertEdit(0, indentString));
        edit.addChildren(edits);
        } else {
           return unformatted;
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.