Added more Wikipedia configurations
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPUnitEditor.java
index 5aa3cca..56229b2 100644 (file)
@@ -44,6 +44,7 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Preferences;
+import net.sourceforge.phpeclipse.phpeditor.ICompilationUnitDocumentProvider;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuManager;
@@ -104,8 +105,8 @@ import org.eclipse.ui.texteditor.TextOperationAction;
  * the Common Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/cpl-v10.html
  * 
- * Contributors: IBM Corporation - Initial implementation Klaus Hartlage -
- * www.eclipseproject.de
+ * Contributors: IBM Corporation - Initial implementation 
+ * www.phpeclipse.de
  ******************************************************************************/
 /**
  * PHP specific text editor.
@@ -1305,7 +1306,7 @@ public class PHPUnitEditor extends PHPEditor { //implements
   private final static String CLOSE_STRINGS_SQ_PHP = PreferenceConstants.EDITOR_CLOSE_STRINGS_SQ_PHP;
 
   /** Preference key for automatically wrapping Java strings */
-  private final static String WRAP_STRINGS = PreferenceConstants.EDITOR_WRAP_STRINGS;
+//  private final static String WRAP_STRINGS = PreferenceConstants.EDITOR_WRAP_STRINGS_DQ;
 
   /** Preference key for automatically closing brackets and parenthesis */
   private final static String CLOSE_BRACKETS_PHP = PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP;
@@ -2300,16 +2301,24 @@ public class PHPUnitEditor extends PHPEditor { //implements
     }
   }
 
-  private void configureTabConverter() {
-    if (fTabConverter != null) {
-      IDocumentProvider provider = getDocumentProvider();
-      if (provider instanceof PHPDocumentProvider) {
-        PHPDocumentProvider cup = (PHPDocumentProvider) provider;
-        fTabConverter.setLineTracker(cup.createLineTracker(getEditorInput()));
-      }
-    }
-  }
-
+  //  private void configureTabConverter() {
+  //    if (fTabConverter != null) {
+  //      IDocumentProvider provider = getDocumentProvider();
+  //      if (provider instanceof PHPDocumentProvider) {
+  //        PHPDocumentProvider cup = (PHPDocumentProvider) provider;
+  //        fTabConverter.setLineTracker(cup.createLineTracker(getEditorInput()));
+  //      }
+  //    }
+  //  }
+       private void configureTabConverter() {
+               if (fTabConverter != null) {
+                       IDocumentProvider provider= getDocumentProvider();
+                       if (provider instanceof ICompilationUnitDocumentProvider) {
+                               ICompilationUnitDocumentProvider cup= (ICompilationUnitDocumentProvider) provider;
+                               fTabConverter.setLineTracker(cup.createLineTracker(getEditorInput()));
+                       }
+               }
+       }
   private void startTabConversion() {
     if (fTabConverter == null) {
       fTabConverter = new TabConverter();
@@ -2336,19 +2345,33 @@ public class PHPUnitEditor extends PHPEditor { //implements
    * @see org.eclipse.ui.texteditor.AbstractTextEditor#performSave(boolean, org.eclipse.core.runtime.IProgressMonitor)
    */
   protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) {
-    IDocumentProvider p = getDocumentProvider();
-    if (p instanceof PHPDocumentProvider) {
-      PHPDocumentProvider cp = (PHPDocumentProvider) p;
-      cp.setSavePolicy(fSavePolicy);
-    }
-    try {
-      super.performSave(overwrite, progressMonitor);
-    } finally {
-      if (p instanceof PHPDocumentProvider) {
-        PHPDocumentProvider cp = (PHPDocumentProvider) p;
-        cp.setSavePolicy(null);
-      }
-    }
+//    IDocumentProvider p = getDocumentProvider();
+//    if (p instanceof PHPDocumentProvider) {
+//      PHPDocumentProvider cp = (PHPDocumentProvider) p;
+//      cp.setSavePolicy(fSavePolicy);
+//    }
+//    try {
+//      super.performSave(overwrite, progressMonitor);
+//    } finally {
+//      if (p instanceof PHPDocumentProvider) {
+//        PHPDocumentProvider cp = (PHPDocumentProvider) p;
+//        cp.setSavePolicy(null);
+//      }
+//    }
+    
+    IDocumentProvider p= getDocumentProvider();
+       if (p instanceof ICompilationUnitDocumentProvider) {
+               ICompilationUnitDocumentProvider cp= (ICompilationUnitDocumentProvider) p;
+               cp.setSavePolicy(fSavePolicy);
+       }
+       try {
+               super.performSave(overwrite, progressMonitor);
+       } finally {
+               if (p instanceof ICompilationUnitDocumentProvider) {
+                       ICompilationUnitDocumentProvider cp= (ICompilationUnitDocumentProvider) p;
+                       cp.setSavePolicy(null);
+               }
+       }
   }
 
   /*
@@ -2430,10 +2453,6 @@ public class PHPUnitEditor extends PHPEditor { //implements
     }
   }
 
-  private boolean synchronizeOutlineOnCursorMove() {
-    return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);
-  }
-
   /**
    * Returns the updated java element for the old java element.
    */