Examples of CopySourceInfo


Examples of org.eclipse.php.internal.core.ast.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.getType());
    if (placeholder == null) {
      throw new IllegalArgumentException(
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.rewrite.RewriteEventStore.CopySourceInfo

      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.php.internal.core.ast.rewrite.RewriteEventStore.CopySourceInfo

         * 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()
              .getStart());
          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
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.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.php.internal.core.ast.rewrite.RewriteEventStore.CopySourceInfo

    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);
      this.nodeStore.markAsCopyTarget(newChild, sourceInfo);
    }
  }
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.