if (selectedStatements.length == 1 && ASTNodes.isControlStatementBody(selectedStatements[0].getLocationInParent())) { Block wrap= ast.newBlock(); rewrite.replace(selectedStatements[0], wrap, null);
astRewrite.set(parent, statement.getLocationInParent(), block, group); } else { List<?> rewrittenList= listRewrite.getRewrittenList();
astRewrite.set(parent, statement.getLocationInParent(), block, group); } else { List<?> rewrittenList= listRewrite.getRewrittenList();
if (ASTNodes.isControlStatementBody(enclosingStatement.getLocationInParent())) { Block newBlock= ast.newBlock(); listRewrite= rewrite.getListRewrite(newBlock, Block.STATEMENTS_PROPERTY); rewrite.replace(enclosingStatement, newBlock, null); } else { listRewrite= rewrite.getListRewrite(enclosingStatement.getParent(), (ChildListPropertyDescriptor) enclosingStatement.getLocationInParent()); insertAfter= enclosingStatement; if (ASTNodes.isControlStatementBody(statement.getLocationInParent())) { Block newBlock= ast.newBlock(); listRewrite= rewrite.getListRewrite(newBlock, Block.STATEMENTS_PROPERTY); rewrite.replace(statement, newBlock, null); } else { listRewrite= rewrite.getListRewrite(statement.getParent(), (ChildListPropertyDescriptor) statement.getLocationInParent()); listRewrite.insertBefore(bufferDeclaration, statement, null);
if (ASTNodes.isControlStatementBody(enclosingStatement.getLocationInParent())) { Block newBlock= ast.newBlock(); listRewrite= rewrite.getListRewrite(newBlock, Block.STATEMENTS_PROPERTY); rewrite.replace(enclosingStatement, newBlock, null); } else { listRewrite= rewrite.getListRewrite(enclosingStatement.getParent(), (ChildListPropertyDescriptor) enclosingStatement.getLocationInParent()); insertAfter= enclosingStatement; if (ASTNodes.isControlStatementBody(statement.getLocationInParent())) { Block newBlock= ast.newBlock(); listRewrite= rewrite.getListRewrite(newBlock, Block.STATEMENTS_PROPERTY); rewrite.replace(statement, newBlock, null); } else { listRewrite= rewrite.getListRewrite(statement.getParent(), (ChildListPropertyDescriptor) statement.getLocationInParent()); listRewrite.insertBefore(bufferDeclaration, statement, null);
StructuralPropertyDescriptor property= statement.getLocationInParent(); if (!property.isChildListProperty()) { return false;
StructuralPropertyDescriptor property= statement.getLocationInParent(); if (!property.isChildListProperty()) { return false;
int insertIndex = sourceBlock.statements().indexOf(ifStatement); ListRewrite listRewriter = rewrite.getListRewrite(sourceBlock, (ChildListPropertyDescriptor) statement.getLocationInParent()); listRewriter.replace(ifStatement, firstIf, null); listRewriter.insertAt(secondIf, insertIndex + 1, null);
ASTRewrite rewrite= ASTRewrite.create(ast); while (statement.getLocationInParent() == IfStatement.ELSE_STATEMENT_PROPERTY) { statement= (Statement) statement.getParent();
while (topLabelStatement.getLocationInParent() == LabeledStatement.BODY_PROPERTY) { topLabelStatement= (Statement) topLabelStatement.getParent();
while (topLabelStatement.getLocationInParent() == LabeledStatement.BODY_PROPERTY) { topLabelStatement= (Statement) topLabelStatement.getParent();
StructuralPropertyDescriptor property= statement.getLocationInParent(); if (!property.isChildListProperty()) { return false;
if (ASTNodes.isControlStatementBody(dominantStatement.getLocationInParent())) { dominantStatement= (Statement) dominantStatement.getParent(); StructuralPropertyDescriptor childProperty= statement.getLocationInParent(); if (childProperty.isChildListProperty()) { rewrite.getListRewrite(parent, (ChildListPropertyDescriptor) childProperty).insertBefore(newDecl, statement, null);
if (ASTNodes.isControlStatementBody(dominantStatement.getLocationInParent())) { dominantStatement= (Statement) dominantStatement.getParent(); StructuralPropertyDescriptor childProperty= statement.getLocationInParent(); if (childProperty.isChildListProperty()) { rewrite.getListRewrite(parent, (ChildListPropertyDescriptor) childProperty).insertBefore(newDecl, statement, null);
if (ASTNodes.isControlStatementBody(dominantStatement.getLocationInParent())) { dominantStatement= (Statement) dominantStatement.getParent(); StructuralPropertyDescriptor childProperty= statement.getLocationInParent(); if (childProperty.isChildListProperty()) { rewrite.getListRewrite(parent, (ChildListPropertyDescriptor) childProperty).insertBefore(newDecl, statement, null);
if (ASTNodes.isControlStatementBody(dominantStatement.getLocationInParent())) { dominantStatement= (Statement) dominantStatement.getParent(); StructuralPropertyDescriptor childProperty= statement.getLocationInParent(); if (childProperty.isChildListProperty()) { rewrite.getListRewrite(parent, (ChildListPropertyDescriptor) childProperty).insertBefore(newDecl, statement, null);