Examples of TextEditGroup


Examples of org.eclipse.text.edits.TextEditGroup

    }
    int oldDim= ((Integer) event.getOriginalValue()).intValue();
    int newDim= ((Integer) event.getNewValue()).intValue();

    if (oldDim != newDim) {
      TextEditGroup editGroup= getEditGroup(event);
      rewriteExtraDimensions(oldDim, newDim, pos, editGroup);
    }
    return oldDim;
  }
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

      return;
    }
    try {
      int oldModifiers= ((Integer) event.getOriginalValue()).intValue();
      int newModifiers= ((Integer) event.getNewValue()).intValue();
      TextEditGroup editGroup= getEditGroup(event);

      TokenScanner scanner= getScanner();

      int tok= scanner.readNext(offset, false);
      int startPos= scanner.getCurrentStartOffset();
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

  private void rewriteOperation(ASTNode parent, StructuralPropertyDescriptor property, int posBeforeOperation) {
    RewriteEvent event= getEvent(parent, property);
    if (event != null && event.getChangeKind() != RewriteEvent.UNCHANGED) {
      try {
        String newOperation= event.getNewValue().toString();
        TextEditGroup editGroup= getEditGroup(event);
        getScanner().readNext(posBeforeOperation, true);
        doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup);
      } catch (CoreException e) {
        handleException(e);
      }
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

  /* (non-Javadoc)
   * @see org.eclipse.jdt.core.dom.ASTVisitor#postVisit(ASTNode)
   */
  public void postVisit(ASTNode node) {
    TextEditGroup editGroup= this.eventStore.getTrackedNodeData(node);
    if (editGroup != null) {
      this.currentEdit= this.currentEdit.getParent();
    }
    // remove copy source edits
    doCopySourcePostVisit(node, this.sourceCopyEndNodes);
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    // copies, then range marker

    CopySourceInfo[] infos= this.eventStore.getNodeCopySources(node);
    doCopySourcePreVisit(infos, this.sourceCopyEndNodes);

    TextEditGroup editGroup= this.eventStore.getTrackedNodeData(node);
    if (editGroup != null) {
      SourceRange range= getExtendedRange(node);
      int offset= range.getStartPosition();
      int length= range.getLength();
      TextEdit edit= new RangeMarker(offset, length);
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    ASTNode newReturnType= (ASTNode) getNewValue(node, property);
    if (isConstructorChange || !returnTypeExists && newReturnType != originalReturnType) {
      // use the start offset of the method name to insert
      ASTNode originalMethodName= (ASTNode) getOriginalValue(node, MethodDeclaration.NAME_PROPERTY);
      int nextStart= originalMethodName.getStartPosition(); // see bug 84049: can't use extended offset
      TextEditGroup editGroup= getEditGroup(node, property);
      if (isConstructor || !returnTypeExists) { // insert
        doTextInsert(nextStart, newReturnType, getIndent(nextStart), true, editGroup);
        doTextInsert(nextStart, " ", editGroup); //$NON-NLS-1$
      } else { // remove up to the method name
        int offset= getExtendedOffset(originalReturnType);
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    ArrayType arrayType= (ArrayType) getOriginalValue(node, ArrayCreation.TYPE_PROPERTY);
    int nOldBrackets= getDimensions(arrayType); // number of total brackets
    int nNewBrackets= nOldBrackets;

    TextEditGroup editGroup= null;
    RewriteEvent typeEvent= getEvent(node, ArrayCreation.TYPE_PROPERTY);
    if (typeEvent != null && typeEvent.getChangeKind() == RewriteEvent.REPLACED) { // changed arraytype can have different dimension or type name
      ArrayType replacingType= (ArrayType) typeEvent.getNewValue();
      editGroup= getEditGroup(typeEvent);
      Type newType= replacingType.getElementType();
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    if (!hasChildrenChanges(node)) {
      return doVisitUnchangedChildren(node);
    }

    Boolean newLiteral= (Boolean) getNewValue(node, BooleanLiteral.BOOLEAN_VALUE_PROPERTY);
    TextEditGroup group = getEditGroup(node, BooleanLiteral.BOOLEAN_VALUE_PROPERTY);
    doTextReplace(node.getStartPosition(), node.getLength(), newLiteral.toString(), group);
    return false;
  }
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    if (!hasChildrenChanges(node)) {
      return doVisitUnchangedChildren(node);
    }

    String escapedSeq= (String) getNewValue(node, CharacterLiteral.ESCAPED_VALUE_PROPERTY);
    TextEditGroup group = getEditGroup(node, CharacterLiteral.ESCAPED_VALUE_PROPERTY);
    doTextReplace(node.getStartPosition(), node.getLength(), escapedSeq, group);
    return false;
  }
View Full Code Here

Examples of org.eclipse.text.edits.TextEditGroup

    RewriteEvent event= getEvent(node, InfixExpression.EXTENDED_OPERANDS_PROPERTY);
    String prefixString= ' ' + operation + ' ';

    if (needsNewOperation) {
      int startPos= pos;
      TextEditGroup editGroup= getEditGroup(node, InfixExpression.OPERATOR_PROPERTY);

      if (event != null && event.getChangeKind() != RewriteEvent.UNCHANGED) {
        RewriteEvent[] extendedOperands= event.getChildren();
        for (int i= 0; i < extendedOperands.length; i++) {
          RewriteEvent curr= extendedOperands[i];
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.