A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / java / JavaFormattingStrategy.java
index 56ba202..0fd345d 100644 (file)
@@ -15,43 +15,43 @@ import org.eclipse.jface.text.source.ISourceViewer;
 
 public class JavaFormattingStrategy implements IFormattingStrategy {
 
-  private String fInitialIndentation;
-
-  private ISourceViewer fViewer;
-
-  public JavaFormattingStrategy(ISourceViewer viewer) {
-    fViewer = viewer;
-  }
-
-  /**
-   * @see IFormattingStrategy#formatterStarts(String)
-   */
-  public void formatterStarts(String initialIndentation) {
-    fInitialIndentation = initialIndentation;
-  }
-
-  /**
-   * @see IFormattingStrategy#formatterStops()
-   */
-  public void formatterStops() {
-  }
-
-  /**
-   * @see IFormattingStrategy#format(String, boolean, String, int[])
-   */
-  public String format(String content, boolean isLineStart, String indentation,
-      int[] positions) {
-    ICodeFormatter formatter = ToolFactory.createCodeFormatter();
-
-    IDocument doc = fViewer.getDocument();
-    String lineDelimiter = StubUtility.getLineDelimiterFor(doc);
-
-    int indent = 0;
-    if (fInitialIndentation != null) {
-      indent = Strings.computeIndent(fInitialIndentation,
-          CodeFormatterPreferencePage.getTabSize());
-    }
-
-    return formatter.format(content, indent, positions, lineDelimiter);
-  }
+       private String fInitialIndentation;
+
+       private ISourceViewer fViewer;
+
+       public JavaFormattingStrategy(ISourceViewer viewer) {
+               fViewer = viewer;
+       }
+
+       /**
+        * @see IFormattingStrategy#formatterStarts(String)
+        */
+       public void formatterStarts(String initialIndentation) {
+               fInitialIndentation = initialIndentation;
+       }
+
+       /**
+        * @see IFormattingStrategy#formatterStops()
+        */
+       public void formatterStops() {
+       }
+
+       /**
+        * @see IFormattingStrategy#format(String, boolean, String, int[])
+        */
+       public String format(String content, boolean isLineStart,
+                       String indentation, int[] positions) {
+               ICodeFormatter formatter = ToolFactory.createCodeFormatter();
+
+               IDocument doc = fViewer.getDocument();
+               String lineDelimiter = StubUtility.getLineDelimiterFor(doc);
+
+               int indent = 0;
+               if (fInitialIndentation != null) {
+                       indent = Strings.computeIndent(fInitialIndentation,
+                                       CodeFormatterPreferencePage.getTabSize());
+               }
+
+               return formatter.format(content, indent, positions, lineDelimiter);
+       }
 }
\ No newline at end of file