switch (this.insertionPolicy) { case INSERT_BEFORE: ASTNode element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertBefore(child, element, null); break; case INSERT_AFTER: element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertAfter(child, element, null);
switch (this.insertionPolicy) { case INSERT_BEFORE: ASTNode element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertBefore(child, element, null); break; case INSERT_AFTER: element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertAfter(child, element, null);
switch (this.insertionPolicy) { case INSERT_BEFORE: ASTNode element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertBefore(child, element, null); break; case INSERT_AFTER: element = ((JavaElement) this.anchorElement).findNode(this.cuAST); if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass())) rewrite.insertAfter(child, element, null);
IType currentType = types[i]; if (currentType.getElementName().equals(oldTypeName)) { AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU); if (typeNode != null) {
IType currentType = types[i]; if (currentType.getElementName().equals(oldTypeName)) { AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU); if (typeNode != null) {
IType currentType = types[i]; if (currentType.getElementName().equals(oldTypeName)) { AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU); if (typeNode != null) {
IType currentType = types[i]; if (currentType.getElementName().equals(oldTypeName)) { AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU); if (typeNode != null) {
IType currentType = types[i]; if (currentType.getElementName().equals(oldTypeName)) { AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU); if (typeNode != null) {
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
protected void generateNewCompilationUnitAST(ICompilationUnit cu) throws JavaModelException { this.cuAST = parse(cu); AST ast = this.cuAST.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); ASTNode child = generateElementAST(rewriter, cu); if (child != null) { ASTNode parent = ((JavaElement) getParentElement()).findNode(this.cuAST); if (parent == null) parent = this.cuAST; insertASTNode(rewriter, parent, child); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); } worked(1); } /**
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }
private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); this.parser.setSource(cu); CompilationUnit astCU = (CompilationUnit) this.parser.createAST(this.progressMonitor); ASTNode node = ((JavaElement) elementToRemove).findNode(astCU); if (node == null) Assert.isTrue(false, "Failed to locate " + elementToRemove.getElementName() + " in " + cu.getElementName()); //$NON-NLS-1$//$NON-NLS-2$ AST ast = astCU.getAST(); ASTRewrite rewriter = ASTRewrite.create(ast); rewriter.remove(node, null); TextEdit edits = rewriter.rewriteAST(); applyTextEdit(cu, edits); }