private CompilationUnit getASTRoot() { if (fASTRoot == null) { fASTRoot= RefactoringASTParser.parseWithASTProvider(fCu, true, null); } return fASTRoot; }
private CompilationUnit getASTRoot() { if (fASTRoot == null) { fASTRoot= RefactoringASTParser.parseWithASTProvider(fCu, true, null); } return fASTRoot; }
private CompilationUnit getASTRoot() { if (fASTRoot == null) { fASTRoot= RefactoringASTParser.parseWithASTProvider(fCu, true, null); } return fASTRoot; }
private void initAST(IProgressMonitor pm){ if (fCompilationUnitNode == null) { fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, pm); fTempDeclarationNode= TempDeclarationFinder.findTempDeclaration(fCompilationUnitNode, fSelectionStart, fSelectionLength); } }
private void initAST(IProgressMonitor pm){ if (fCompilationUnitNode == null) { fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, pm); fTempDeclarationNode= TempDeclarationFinder.findTempDeclaration(fCompilationUnitNode, fSelectionStart, fSelectionLength); } }
private void initAST(IProgressMonitor pm){ if (fCompilationUnitNode == null) { fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, pm); fTempDeclarationNode= TempDeclarationFinder.findTempDeclaration(fCompilationUnitNode, fSelectionStart, fSelectionLength); } }
private static Change createDeleteChange(ICompilationUnit cu, List<IJavaElement> javaElements, TextChangeManager manager) throws CoreException { CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(cu, false, null); CompilationUnitRewrite rewriter= new CompilationUnitRewrite(cu, cuNode); IJavaElement[] elements= javaElements.toArray(new IJavaElement[javaElements.size()]); ASTNodeDeleteUtil.markAsDeleted(elements, rewriter, null); return addTextEditFromRewrite(manager, cu, rewriter.getASTRewrite()); }
private static Change createDeleteChange(ICompilationUnit cu, List<IJavaElement> javaElements, TextChangeManager manager) throws CoreException { CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(cu, false, null); CompilationUnitRewrite rewriter= new CompilationUnitRewrite(cu, cuNode); IJavaElement[] elements= javaElements.toArray(new IJavaElement[javaElements.size()]); ASTNodeDeleteUtil.markAsDeleted(elements, rewriter, null); return addTextEditFromRewrite(manager, cu, rewriter.getASTRewrite()); }
private static Change createDeleteChange(ICompilationUnit cu, List<IJavaElement> javaElements, TextChangeManager manager) throws CoreException { CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(cu, false, null); CompilationUnitRewrite rewriter= new CompilationUnitRewrite(cu, cuNode); IJavaElement[] elements= javaElements.toArray(new IJavaElement[javaElements.size()]); ASTNodeDeleteUtil.markAsDeleted(elements, rewriter, null); return addTextEditFromRewrite(manager, cu, rewriter.getASTRewrite()); }
private static Change createDeleteChange(ICompilationUnit cu, List javaElements, TextChangeManager manager) throws CoreException { CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(cu, false, null); CompilationUnitRewrite rewriter= new CompilationUnitRewrite(cu, cuNode); IJavaElement[] elements= (IJavaElement[]) javaElements.toArray(new IJavaElement[javaElements.size()]); ASTNodeDeleteUtil.markAsDeleted(elements, rewriter, null); return addTextEditFromRewrite(manager, cu, rewriter.getASTRewrite()); }
private void initAST() { if (!fIsComposite) fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, null); ISourceRange sourceRange= fLocalVariable.getNameRange(); ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange); if (name == null) return; if (name.getParent() instanceof VariableDeclaration) fTempDeclarationNode= (VariableDeclaration) name.getParent(); }
private void initAST() { if (!fIsComposite) fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, null); ISourceRange sourceRange= fLocalVariable.getNameRange(); ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange); if (name == null) return; if (name.getParent() instanceof VariableDeclaration) fTempDeclarationNode= (VariableDeclaration) name.getParent(); }
private void initAST() throws JavaModelException { if (!fIsComposite) fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, null); ISourceRange sourceRange= fLocalVariable.getNameRange(); ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange); if (name == null) return; if (name.getParent() instanceof VariableDeclaration) fTempDeclarationNode= (VariableDeclaration) name.getParent(); }
private void initAST() { if (!fIsComposite) { fCompilationUnitNode= RefactoringASTParser.parseWithASTProvider(fCu, true, null); } ISourceRange sourceRange= fLocalVariable.getNameRange(); ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange); if (name == null) { return; } if (name.getParent() instanceof VariableDeclaration) { fTempDeclarationNode= (VariableDeclaration) name.getParent(); } }
private void run(int offset, int length, ICompilationUnit cu) { Assert.isNotNull(cu); Assert.isTrue(offset >= 0); Assert.isTrue(length >= 0); if (!ActionUtil.isEditable(fEditor, getShell(), cu)) return; CompilationUnit node= RefactoringASTParser.parseWithASTProvider(cu, true, null); if (!RefactoringExecutionStarter.startInlineConstantRefactoring(cu, node, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineConstantAction_dialog_title, RefactoringMessages.InlineConstantAction_no_constant_reference_or_declaration); } }
private void run(int offset, int length, ICompilationUnit cu) { Assert.isNotNull(cu); Assert.isTrue(offset >= 0); Assert.isTrue(length >= 0); if (!ActionUtil.isEditable(fEditor, getShell(), cu)) return; CompilationUnit node= RefactoringASTParser.parseWithASTProvider(cu, true, null); if (!RefactoringExecutionStarter.startInlineConstantRefactoring(cu, node, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineConstantAction_dialog_title, RefactoringMessages.InlineConstantAction_no_constant_reference_or_declaration); } }
private void run(int offset, int length, ITypeRoot typeRoot) { if (!ActionUtil.isEditable(fEditor, getShell(), typeRoot)) return; CompilationUnit compilationUnit= RefactoringASTParser.parseWithASTProvider(typeRoot, true, null); if (!RefactoringExecutionStarter.startInlineMethodRefactoring(typeRoot, compilationUnit, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineMethodAction_dialog_title, RefactoringMessages.InlineMethodAction_no_method_invocation_or_declaration_selected); } }
private void run(int offset, int length, ITypeRoot typeRoot) { if (!ActionUtil.isEditable(fEditor, getShell(), typeRoot)) return; CompilationUnit compilationUnit= RefactoringASTParser.parseWithASTProvider(typeRoot, true, null); if (!RefactoringExecutionStarter.startInlineMethodRefactoring(typeRoot, compilationUnit, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineMethodAction_dialog_title, RefactoringMessages.InlineMethodAction_no_method_invocation_or_declaration_selected); } }
private void run(int offset, int length, ICompilationUnit cu) { Assert.isNotNull(cu); Assert.isTrue(offset >= 0); Assert.isTrue(length >= 0); if (!ActionUtil.isEditable(fEditor, getShell(), cu)) return; try { CompilationUnit node= RefactoringASTParser.parseWithASTProvider(cu, true, null); if (! RefactoringExecutionStarter.startInlineConstantRefactoring(cu, node, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineConstantAction_dialog_title, RefactoringMessages.InlineConstantAction_no_constant_reference_or_declaration); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.InlineConstantAction_dialog_title, RefactoringMessages.InlineConstantAction_unexpected_exception); } }
private void run(int offset, int length, ITypeRoot typeRoot) { if (!ActionUtil.isEditable(fEditor, getShell(), typeRoot)) return; try { CompilationUnit compilationUnit= RefactoringASTParser.parseWithASTProvider(typeRoot, true, null); if (! RefactoringExecutionStarter.startInlineMethodRefactoring(typeRoot, compilationUnit, offset, length, getShell())) { MessageDialog.openInformation(getShell(), RefactoringMessages.InlineMethodAction_dialog_title, RefactoringMessages.InlineMethodAction_no_method_invocation_or_declaration_selected); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.InlineMethodAction_dialog_title, RefactoringMessages.InlineMethodAction_unexpected_exception); } }