Package org.eclipse.php.internal.core.ast.rewrite

Examples of org.eclipse.php.internal.core.ast.rewrite.ASTRewrite.replace()


      } else {
        if(!createdMethodBody) {
          addReturnStatement(ast, extractedMethodBody, ASTNode.copySubtree(ast, selectedNodeOccurence.get(0)));
          createdMethodBody = true;
        }
        rewriter.replace( selectedNodeOccurence.get(0), inlineMethodCall, inlineReplacementEditGroup);
      }
    }
   

    classListRewrite.insertAfter(method, fCoveringDeclarationFinder.getCoveringMethodDeclaration(), newMethodEdit);
View Full Code Here


      linkedModel.getPositionGroup(KEY_NAME, true).addProposal(names[0], null, 10);
    }
    Variable variable = ast.newVariable(names[0]);
   
    Assignment assign = ast.newAssignment(variable, Assignment.OP_EQUAL, (Expression) astRewrite.createCopyTarget(expression));
    astRewrite.replace(expression, assign, editGroup);

    linkedModel.getPositionGroup(KEY_NAME, true).addPosition(astRewrite.track(variable.getName()), true);
    linkedModel.setEndPosition(astRewrite.track(statement));
   
    return astRewrite;
View Full Code Here

    initialize(str);
    List<ThrowStatement> allthrows = getAllOfType(program,
        ThrowStatement.class);
    ASTRewrite rewrite = ASTRewrite.create(program.getAST());

    rewrite.replace(
        allthrows.get(0),
        rewrite.createGroupNode(new ASTNode[] { allthrows.get(0),
            program.getAST().newBreakStatement() }), null);
    rewrite.rewriteAST(document, null).apply(document);
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.