From: bananeweizen Date: Tue, 24 Jan 2006 21:12:34 +0000 (+0000) Subject: replaced deprecated interface X-Git-Url: http://git.phpeclipse.com replaced deprecated interface --- 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 5647b5b..f2956f0 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 @@ -6,35 +6,35 @@ which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html Contributors: - IBM Corporation - Initial implementation - www.phpeclipse.de + IBM Corporation - Initial implementation + www.phpeclipse.de **********************************************************************/ package net.sourceforge.phpeclipse.phpeditor.php; import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultAutoIndentStrategy; +import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; /** * Auto indent strategy sensitive to brackets. */ -public class PHPAutoIndentStrategy extends DefaultAutoIndentStrategy { +public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { 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 DefaultAutoIndentStrategy { 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 DefaultAutoIndentStrategy { 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,7 +76,7 @@ public class PHPAutoIndentStrategy extends DefaultAutoIndentStrategy { } return line; } - + /** * Returns the bracket value of a section of text. Closing brackets have a value of -1 and * open brackets have a value of 1. @@ -101,7 +101,7 @@ public class PHPAutoIndentStrategy extends DefaultAutoIndentStrategy { // 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 DefaultAutoIndentStrategy { } 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 DefaultAutoIndentStrategy { } 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 DefaultAutoIndentStrategy { 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 DefaultAutoIndentStrategy { } 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 DefaultAutoIndentStrategy { 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