X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java index 8096bb0..5647b5b 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java @@ -12,29 +12,29 @@ Contributors: package net.sourceforge.phpeclipse.phpeditor.php; import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy; +import org.eclipse.jface.text.DefaultAutoIndentStrategy; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; /** * Auto indent strategy sensitive to brackets. */ -public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { +public class PHPAutoIndentStrategy extends DefaultAutoIndentStrategy { public PHPAutoIndentStrategy() { } - + /* (non-Javadoc) * Method declared on IAutoIndentStrategy */ public void customizeDocumentCommand(IDocument d, DocumentCommand c) { if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) smartIndentAfterNewLine(d, c); - else if ("}".equals(c.text)) { + else if ("}".equals(c.text)) { smartInsertAfterBracket(d, c); } } - + /** * Returns whether or not the text ends with one of the given search strings. */ @@ -49,7 +49,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { return false; } - + /** * Returns the line number of the next bracket after end. * @returns the line number of the next matching bracket after end @@ -63,7 +63,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { int start= document.getLineOffset(line); int brackcount= getBracketCount(document, start, end, false) - closingBracketIncrease; - // sum up the brackets counts of each line (closing brackets count negative, + // sum up the brackets counts of each line (closing brackets count negative, // opening positive) until we find a line the brings the count to zero while (brackcount < 0) { line--; @@ -76,9 +76,9 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { } return line; } - + /** - * Returns the bracket value of a section of text. Closing brackets have a value of -1 and + * Returns the bracket value of a section of text. Closing brackets have a value of -1 and * open brackets have a value of 1. * @returns the line number of the next matching bracket after end * @param document - the document being parsed @@ -101,7 +101,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { // a comment starts, advance to the comment end begin= getCommentEnd(document, begin + 1, end); } else if (next == '/') { - // '//'-comment: nothing to do anymore on this line + // '//'-comment: nothing to do anymore on this line begin= end; } } @@ -134,7 +134,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { } return bracketcount; } - + /** * Returns the end position a comment starting at pos. * @returns the end position a comment starting at pos @@ -155,7 +155,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { } return end; } - + /** * Returns the String at line with the leading whitespace removed. * @returns the String at line with the leading whitespace removed. @@ -172,7 +172,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { return ""; //$NON-NLS-1$ } } - + /** * Returns the position of the character in the document after position. * @returns the next location of character. @@ -195,7 +195,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { } return end; } - + /** * Set the indent of a new line based on the command provided in the supplied document. * @param document - the document being parsed @@ -239,7 +239,7 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { System.out.println(PHPEditorMessages.getString("AutoIndent.error.bad_location_1")); //$NON-NLS-1$ } } - + /** * Set the indent of a bracket based on the command provided in the supplied document. * @param document - the document being parsed