/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, CompilationUnitDeclaration compilationUnitDeclaration) { // reset the scribe this.scribe.reset(); if (compilationUnitDeclaration == null || compilationUnitDeclaration.ignoreFurtherInvestigation) { return failedToFormat(); } long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); this.lastLocalDeclarationSourceStart = -1; try { compilationUnitDeclaration.traverse(this, compilationUnitDeclaration.scope); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, CompilationUnitDeclaration compilationUnitDeclaration) { // reset the scribe this.scribe.reset(); if (compilationUnitDeclaration == null || compilationUnitDeclaration.ignoreFurtherInvestigation) { return failedToFormat(); } long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); this.lastLocalDeclarationSourceStart = -1; try { compilationUnitDeclaration.traverse(this, compilationUnitDeclaration.scope); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, CompilationUnitDeclaration compilationUnitDeclaration) { // reset the scribe this.scribe.reset(); if (compilationUnitDeclaration == null || compilationUnitDeclaration.ignoreFurtherInvestigation) { return failedToFormat(); } long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); this.lastLocalDeclarationSourceStart = -1; try { compilationUnitDeclaration.traverse(this, compilationUnitDeclaration.scope); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, ASTNode[] nodes) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (nodes == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { formatClassBodyDeclarations(nodes); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, ASTNode[] nodes) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (nodes == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { formatClassBodyDeclarations(nodes); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, ASTNode[] nodes) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (nodes == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { formatClassBodyDeclarations(nodes); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, Expression expression) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (expression == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { expression.traverse(this, (BlockScope) null); this.scribe.printComment(); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, Expression expression) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (expression == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { expression.traverse(this, (BlockScope) null); this.scribe.printComment(); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
/** * @see org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String) */ public TextEdit format(String string, Expression expression) { // reset the scribe this.scribe.reset(); long startTime = 0; if (DEBUG) { startTime = System.currentTimeMillis(); } final char[] compilationUnitSource = string.toCharArray(); this.localScanner.setSource(compilationUnitSource); this.scribe.resetScanner(compilationUnitSource); if (expression == null) { return null; } this.lastLocalDeclarationSourceStart = -1; try { expression.traverse(this, (BlockScope) null); this.scribe.printComment(); } catch(AbortFormatting e){ return failedToFormat(); } if (DEBUG){ System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$ } return this.scribe.getRootEdit(); }
return failedToFormat();