Examples of CopySourceInfo


Examples of org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

    if (node == null) {
      throw new IllegalArgumentException();
    }
    validateIsExistingNode(node);
    validateIsCorrectAST(node);
    CopySourceInfo info= getRewriteEventStore().markAsCopySource(node.getParent(), node.getLocationInParent(), node, isMove);
 
    ASTNode placeholder= getNodeStore().newPlaceholderNode(node.getNodeType());
    if (placeholder == null) {
      throw new IllegalArgumentException("Creating a target node is not supported for nodes of type" + node.getClass().getName()); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

    if (placeholder == null) {
      throw new IllegalArgumentException("Creating a target node is not supported for nodes of type" + first.getClass().getName()); //$NON-NLS-1$
    }
   
    Block internalPlaceHolder= nodeStore.createCollapsePlaceholder();
    CopySourceInfo info= getRewriteStore().createRangeCopy(this.parent, this.childProperty, first, last, isMove, internalPlaceHolder, replacingNode, editGroup);
    nodeStore.markAsCopyTarget(placeholder, info);
   
    return placeholder;   
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

  private  void markAsMoveOrCopyTarget(ASTNode node, ASTNode newChild) {
    ASTNode source = (ASTNode)this.clonedNodes.get(newChild);
    if(source != null) {
      if(this.cloneDepth == 0) {
        PropertyLocation propertyLocation = this.eventStore.getPropertyLocation(source, RewriteEventStore.ORIGINAL);
        CopySourceInfo sourceInfo =
          this.eventStore.markAsCopySource(
            propertyLocation.getParent(),
            propertyLocation.getProperty(),
            source,
            false);
        this.nodeStore.markAsCopyTarget(newChild, sourceInfo);
      }
    } else if((newChild.getFlags() & ASTNode.ORIGINAL) != 0) {
      PropertyLocation propertyLocation = this.eventStore.getPropertyLocation(newChild, RewriteEventStore.ORIGINAL);
      CopySourceInfo sourceInfo =
        this.eventStore.markAsCopySource(
          propertyLocation.getParent(),
          propertyLocation.getProperty(),
          newChild,
          true);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

        }
        currPos= offset;
      } else {
        String destIndentString=  this.formatter.getIndentString(getCurrentLine(formatted, offset));
        if (data instanceof CopyPlaceholderData) { // replace with a copy/move target
          CopySourceInfo copySource= ((CopyPlaceholderData) data).copySource;
          int srcIndentLevel= getIndent(copySource.getNode().getStartPosition());
          TextEdit sourceEdit= getCopySourceEdit(copySource);
          doTextCopy(sourceEdit, insertOffset, srcIndentLevel, destIndentString, editGroup);
          currPos= offset + curr.length; // continue to insert after the replaced string
          if (needsNewLineForLineComment(copySource.getNode(), formatted, currPos)) {
            doTextInsert(insertOffset, getLineDelimiter(), editGroup);
          }
        } else if (data instanceof StringPlaceholderData) { // replace with a placeholder
          String code= ((StringPlaceholderData) data).code;
          String str= this.formatter.changeIndent(code, 0, destIndentString);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

  }
 
  final void doCopySourcePreVisit(CopySourceInfo[] infos, Stack nodeEndStack) {
    if (infos != null) {
      for (int i= 0; i < infos.length; i++) {
        CopySourceInfo curr= infos[i];
        TextEdit edit= getCopySourceEdit(curr);
        addEdit(edit);
        this.currentEdit= edit;
        nodeEndStack.push(curr.getNode());
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

  private  void markAsMoveOrCopyTarget(ASTNode node, ASTNode newChild) {
    ASTNode source = (ASTNode)this.clonedNodes.get(newChild);
    if(source != null) {
      if(this.cloneDepth == 0) {
        PropertyLocation propertyLocation = this.eventStore.getPropertyLocation(source, RewriteEventStore.ORIGINAL);
        CopySourceInfo sourceInfo =
          this.eventStore.markAsCopySource(
            propertyLocation.getParent(),
            propertyLocation.getProperty(),
            source,
            false);
        this.nodeStore.markAsCopyTarget(newChild, sourceInfo);
      }
    } else if((newChild.getFlags() & ASTNode.ORIGINAL) != 0) {
      PropertyLocation propertyLocation = this.eventStore.getPropertyLocation(newChild, RewriteEventStore.ORIGINAL);
      CopySourceInfo sourceInfo =
        this.eventStore.markAsCopySource(
          propertyLocation.getParent(),
          propertyLocation.getProperty(),
          newChild,
          true);
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

    if (node == null) {
      throw new IllegalArgumentException();
    }
    validateIsExistingNode(node);
    validateIsCorrectAST(node);
    CopySourceInfo info= getRewriteEventStore().markAsCopySource(node.getParent(), node.getLocationInParent(), node, isMove);

    ASTNode placeholder= getNodeStore().newPlaceholderNode(node.getNodeType());
    if (placeholder == null) {
      throw new IllegalArgumentException("Creating a target node is not supported for nodes of type" + node.getClass().getName()); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

    if (placeholder == null) {
      throw new IllegalArgumentException("Creating a target node is not supported for nodes of type" + first.getClass().getName()); //$NON-NLS-1$
    }

    Block internalPlaceHolder= nodeStore.createCollapsePlaceholder();
    CopySourceInfo info= getRewriteStore().createRangeCopy(this.parent, this.childProperty, first, last, isMove, internalPlaceHolder, replacingNode, editGroup);
    nodeStore.markAsCopyTarget(placeholder, info);

    return placeholder;
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

        }
        currPos= offset;
      } else {
        String destIndentString=  this.formatter.getIndentString(getCurrentLine(formatted, offset));
        if (data instanceof CopyPlaceholderData) { // replace with a copy/move target
          CopySourceInfo copySource= ((CopyPlaceholderData) data).copySource;
          int srcIndentLevel= getIndent(copySource.getNode().getStartPosition());
          TextEdit sourceEdit= getCopySourceEdit(copySource);
          doTextCopy(sourceEdit, insertOffset, srcIndentLevel, destIndentString, editGroup);
          currPos= offset + curr.length; // continue to insert after the replaced string
          if (needsNewLineForLineComment(copySource.getNode(), formatted, currPos)) {
            doTextInsert(insertOffset, getLineDelimiter(), editGroup);
          }
        } else if (data instanceof StringPlaceholderData) { // replace with a placeholder
          String code= ((StringPlaceholderData) data).code;
          String str= this.formatter.changeIndent(code, 0, destIndentString);
View Full Code Here

Examples of org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore.CopySourceInfo

  }

  final void doCopySourcePreVisit(CopySourceInfo[] infos, Stack nodeEndStack) {
    if (infos != null) {
      for (int i= 0; i < infos.length; i++) {
        CopySourceInfo curr= infos[i];
        TextEdit edit= getCopySourceEdit(curr);
        addEdit(edit);
        this.currentEdit= edit;
        nodeEndStack.push(curr.getNode());
      }
    }
  }
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.