private int getNextElseOffset(Statement then, ITypeRoot editorInput) { int thenEnd= ASTNodes.getExclusiveEnd(then); try { TokenScanner scanner= new TokenScanner(editorInput); return scanner.getNextStartOffset(thenEnd, true); } catch (CoreException e) { // ignore } return -1; }
private static int internalPerform(MethodDeclaration method) { // we have to find the outermost method declaration since a local or anonymous // type can reference final variables from the outer scope. MethodDeclaration target= method; while (ASTNodes.getParent(target, ASTNode.METHOD_DECLARATION) != null) { target= (MethodDeclaration)ASTNodes.getParent(target, ASTNode.METHOD_DECLARATION); } return doPerform(target); }
@Override public void endVisit(EnumDeclaration node) { --fTypes; super.endVisit(node); }
private IBinding[] getDeclarationsInScope() { if (fDeclarationsInScope == null) { ScopeAnalyzer analyzer= new ScopeAnalyzer(fCompilationUnit); fDeclarationsInScope= analyzer.getDeclarationsInScope(fPosition, ScopeAnalyzer.METHODS | ScopeAnalyzer.TYPES | ScopeAnalyzer.VARIABLES); } return fDeclarationsInScope; }
public void replace(ASTNode[] replacements, TextEditGroup description) { if (fToReplace.length == 1) { if (replacements.length == 1) { handleOneOne(replacements, description); } else { handleOneMany(replacements, description); } } else { handleManyMany(replacements, description); } }
public boolean visit(TypeDeclarationStatement node) { if (hasFlag(TYPES, fFlags) && node.getStartPosition() + node.getLength() < fPosition) { fBreak= fRequestor.acceptBinding(node.resolveBinding()); return false; } return !fBreak && isInside(node); }
@Override public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
@Override public final boolean visit(final TypeDeclaration node) { ModifierRewrite.create(fRewrite, bodyDeclaration).setVisibility(Modifier.PROTECTED, null); return true; } });
/** * Reads until a token is reached. * @param tok The token to read to. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok) throws CoreException { int curr= 0; do { curr= readNext(false); } while (curr != tok); }
@Override public void endVisit(ClassInstanceCreation node) { endVisitNode(node); } @Override
@Override public boolean visit(MarkerAnnotation node) { return visitNode(node); } @Override
public BindingFinder(IBinding binding, ArrayList result) { super(true); fBinding= getDeclaration(binding); fResult= result; }
private int getNextElseOffset(Statement then, ITypeRoot editorInput) { int thenEnd= ASTNodes.getExclusiveEnd(then); try { TokenScanner scanner= new TokenScanner(editorInput); return scanner.getNextStartOffset(thenEnd, true); } catch (CoreException e) { // ignore } return -1; }
public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
/** * Reads until a token is reached. * @param tok The token to read to. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok) throws CoreException { int curr= 0; do { curr= readNext(false); } while (curr != tok); }
@Override public void endVisit(TypeDeclaration node) { --fTypes; super.endVisit(node); }
@Override public void endVisit(EnumDeclaration node) { endVisitNode(node); } @Override
@Override public boolean visit(TagElement node) { return visitNode(node); } @Override
@Override public void endVisit(EnumDeclaration node) { --fTypes; super.endVisit(node); }
@Override public void endVisit(MemberValuePair node) { endVisitNode(node); } @Override