@Override public boolean visit(ConstructorInvocation node) { return visitConstructorInvocation(node, super.visit(node)); }
@Override public boolean visit(SuperConstructorInvocation node) { return visitConstructorInvocation(node, super.visit(node)); }
@Override public boolean visit(ConstructorInvocation node) { return visitConstructorInvocation(node, super.visit(node)); }
@Override public boolean visit(SuperConstructorInvocation node) { return visitConstructorInvocation(node, super.visit(node)); }
@Override public boolean visit(ConstructorInvocation node) { return visitConstructorInvocation(node, super.visit(node)); }
@Override public boolean visit(AnonymousClassDeclaration node) { boolean result = super.visit(node); if (isFirstSelectedNode(node)) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_anonymous_type, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
public boolean visit(AnonymousClassDeclaration node) { boolean result= super.visit(node); if (isFirstSelectedNode(node)) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_anonymous_type, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
@Override public boolean visit(AnonymousClassDeclaration node) { boolean result= super.visit(node); if (isFirstSelectedNode(node)) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_anonymous_type, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
@Override public boolean visit(AnonymousClassDeclaration node) { boolean result= super.visit(node); if (isFirstSelectedNode(node)) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_anonymous_type, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
public boolean visit(VariableDeclarationFragment node) { boolean result= super.visit(node); if (isFirstSelectedNode(node)) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_variable_declaration_fragment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
public boolean visit(Assignment node) { boolean result= super.visit(node); if (getSelection().getVisitSelectionMode(node.getLeftHandSide()) == Selection.SELECTED) { invalidSelection( RefactoringCoreMessages.ExtractMethodAnalyzer_leftHandSideOfAssignment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
@Override public boolean visit(VariableDeclarationFragment node) { boolean result = super.visit(node); if (isFirstSelectedNode(node)) { if (node.getParent() instanceof FieldDeclaration) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_variable_declaration_fragment_from_field, JavaStatusContext.create(fCUnit, node)); } else { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_variable_declaration_fragment, JavaStatusContext.create(fCUnit, node)); } return false; } return result; }
@Override public boolean visit(MethodDeclaration node) { Block body= node.getBody(); if (body == null) return false; Selection selection= getSelection(); int nodeStart= body.getStartPosition(); int nodeExclusiveEnd= nodeStart + body.getLength(); // if selection node inside of the method body ignore method if (!(nodeStart < selection.getOffset() && selection.getExclusiveEnd() < nodeExclusiveEnd)) return false; return super.visit(node); }
@Override public boolean visit(VariableDeclarationFragment node) { boolean result= super.visit(node); if (isFirstSelectedNode(node)) { if (node.getParent() instanceof FieldDeclaration) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_variable_declaration_fragment_from_field, JavaStatusContext.create(fCUnit, node)); } else { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_variable_declaration_fragment, JavaStatusContext.create(fCUnit, node)); } return false; } return result; }
public boolean visit(MethodDeclaration node) { Block body= node.getBody(); if (body == null) return false; Selection selection= getSelection(); int nodeStart= body.getStartPosition(); int nodeExclusiveEnd= nodeStart + body.getLength(); // if selection node inside of the method body ignore method if (!(nodeStart < selection.getOffset() && selection.getExclusiveEnd() < nodeExclusiveEnd)) return false; return super.visit(node); }
public boolean visit(DoStatement node) { boolean result= super.visit(node); try { int actionStart= getTokenScanner().getTokenEndOffset(ITerminalSymbols.TokenNamedo, node.getStartPosition()); if (getSelection().getOffset() == actionStart) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_after_do_keyword, JavaStatusContext.create(fCUnit, getSelection())); return false; } } catch (CoreException e) { // ignore } return result; }
@Override public boolean visit(DoStatement node) { boolean result = super.visit(node); try { int actionStart = getTokenScanner().getTokenEndOffset(ITerminalSymbols.TokenNamedo, node.getStartPosition()); if (getSelection().getOffset() == actionStart) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_after_do_keyword, JavaStatusContext.create(fCUnit, getSelection())); return false; } } catch (CoreException e) { // ignore } return result; }
@Override public boolean visit(Assignment node) { boolean result= super.visit(node); if ((getSelection().covers(node.getLeftHandSide()) && !getSelection().covers(node.getRightHandSide())) || getSelection().coveredBy(node.getLeftHandSide())) { invalidSelection( RefactoringCoreMessages.ExtractMethodAnalyzer_leftHandSideOfAssignment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
@Override public boolean visit(Assignment node) { boolean result = super.visit(node); Selection selection = getSelection(); ASTNode selectedNode = NodeFinder.perform(node, selection.getOffset(), selection.getLength()); if ((selectedNode != null && SnippetFinder.isLeftHandSideOfAssignment(selectedNode)) || (selection.covers(node.getLeftHandSide()) && !selection.covers(node.getRightHandSide()))) { invalidSelection(RefactoringCoreMessages.ExtractMethodAnalyzer_leftHandSideOfAssignment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }
@Override public boolean visit(Assignment node) { boolean result= super.visit(node); Selection selection= getSelection(); ASTNode selectedNode= NodeFinder.perform(node, selection.getOffset(), selection.getLength()); if ((selectedNode != null && SnippetFinder.isLeftHandSideOfAssignment(selectedNode)) || (selection.covers(node.getLeftHandSide()) && !selection.covers(node.getRightHandSide()))) { invalidSelection( RefactoringCoreMessages.ExtractMethodAnalyzer_leftHandSideOfAssignment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }