removed unused private methods.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / corext / util / CodeFormatterUtil.java
index bd39503..00bc0ea 100644 (file)
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package net.sourceforge.phpdt.internal.corext.util;
 
-import java.util.Map;
+//import java.util.Map;
 
 import net.sourceforge.phpdt.core.ToolFactory;
 import net.sourceforge.phpdt.core.formatter.DefaultCodeFormatterConstants;
@@ -23,10 +23,10 @@ import org.eclipse.jface.text.BadPositionCategoryException;
 import org.eclipse.jface.text.DefaultPositionUpdater;
 import org.eclipse.jface.text.Document;
 import org.eclipse.jface.text.Position;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
+//import org.eclipse.text.edits.DeleteEdit;
+//import org.eclipse.text.edits.InsertEdit;
+//import org.eclipse.text.edits.MultiTextEdit;
+//import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
 
 public class CodeFormatterUtil {
@@ -107,27 +107,27 @@ public class CodeFormatterUtil {
        // return getOldAPICompatibleResult(string, edit, indentationLevel,
        // positions, lineSeparator, options);
        // }
-       private static String getOldAPICompatibleResult(String string,
-                       TextEdit edit, int indentationLevel, int[] positions,
-                       String lineSeparator, Map options) {
-               Position[] p = null;
-
-               if (positions != null) {
-                       p = new Position[positions.length];
-                       for (int i = 0; i < positions.length; i++) {
-                               p[i] = new Position(positions[i], 0);
-                       }
-               }
-               String res = evaluateFormatterEdit(string, edit, p);
-
-               if (positions != null) {
-                       for (int i = 0; i < positions.length; i++) {
-                               Position curr = p[i];
-                               positions[i] = curr.getOffset();
-                       }
-               }
-               return res;
-       }
+//     private static String getOldAPICompatibleResult(String string,
+//                     TextEdit edit, int indentationLevel, int[] positions,
+//                     String lineSeparator, Map options) {
+//             Position[] p = null;
+//
+//             if (positions != null) {
+//                     p = new Position[positions.length];
+//                     for (int i = 0; i < positions.length; i++) {
+//                             p[i] = new Position(positions[i], 0);
+//                     }
+//             }
+//             String res = evaluateFormatterEdit(string, edit, p);
+//
+//             if (positions != null) {
+//                     for (int i = 0; i < positions.length; i++) {
+//                             Position curr = p[i];
+//                             positions[i] = curr.getOffset();
+//                     }
+//             }
+//             return res;
+//     }
 
        /**
         * Evaluates the edit on the given string.
@@ -275,32 +275,32 @@ public class CodeFormatterUtil {
        // }
        // return edit;
        // }
-       private static TextEdit shifEdit(TextEdit oldEdit, int diff) {
-               TextEdit newEdit;
-               if (oldEdit instanceof ReplaceEdit) {
-                       ReplaceEdit edit = (ReplaceEdit) oldEdit;
-                       newEdit = new ReplaceEdit(edit.getOffset() - diff,
-                                       edit.getLength(), edit.getText());
-               } else if (oldEdit instanceof InsertEdit) {
-                       InsertEdit edit = (InsertEdit) oldEdit;
-                       newEdit = new InsertEdit(edit.getOffset() - diff, edit.getText());
-               } else if (oldEdit instanceof DeleteEdit) {
-                       DeleteEdit edit = (DeleteEdit) oldEdit;
-                       newEdit = new DeleteEdit(edit.getOffset() - diff, edit.getLength());
-               } else if (oldEdit instanceof MultiTextEdit) {
-                       newEdit = new MultiTextEdit();
-               } else {
-                       return null; // not supported
-               }
-               TextEdit[] children = oldEdit.getChildren();
-               for (int i = 0; i < children.length; i++) {
-                       TextEdit shifted = shifEdit(children[i], diff);
-                       if (shifted != null) {
-                               newEdit.addChild(shifted);
-                       }
-               }
-               return newEdit;
-       }
+//     private static TextEdit shifEdit(TextEdit oldEdit, int diff) {
+//             TextEdit newEdit;
+//             if (oldEdit instanceof ReplaceEdit) {
+//                     ReplaceEdit edit = (ReplaceEdit) oldEdit;
+//                     newEdit = new ReplaceEdit(edit.getOffset() - diff,
+//                                     edit.getLength(), edit.getText());
+//             } else if (oldEdit instanceof InsertEdit) {
+//                     InsertEdit edit = (InsertEdit) oldEdit;
+//                     newEdit = new InsertEdit(edit.getOffset() - diff, edit.getText());
+//             } else if (oldEdit instanceof DeleteEdit) {
+//                     DeleteEdit edit = (DeleteEdit) oldEdit;
+//                     newEdit = new DeleteEdit(edit.getOffset() - diff, edit.getLength());
+//             } else if (oldEdit instanceof MultiTextEdit) {
+//                     newEdit = new MultiTextEdit();
+//             } else {
+//                     return null; // not supported
+//             }
+//             TextEdit[] children = oldEdit.getChildren();
+//             for (int i = 0; i < children.length; i++) {
+//                     TextEdit shifted = shifEdit(children[i], diff);
+//                     if (shifted != null) {
+//                             newEdit.addChild(shifted);
+//                     }
+//             }
+//             return newEdit;
+//     }
 
        private static Document createDocument(String string, Position[] positions)
                        throws IllegalArgumentException {