new PartitionScanner version
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPUnitEditor.java
index a7cc596..f37c360 100644 (file)
@@ -19,6 +19,7 @@ import net.sourceforge.phpdt.internal.ui.text.ContentAssistPreference;
 import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions;
 import net.sourceforge.phpdt.internal.ui.text.PHPPairMatcher;
 import net.sourceforge.phpdt.internal.ui.text.SmartBackspaceManager;
+import net.sourceforge.phpdt.internal.ui.text.SmartSemicolonAutoEditStrategy;
 import net.sourceforge.phpdt.internal.ui.text.java.IJavaReconcilingListener;
 import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionManager;
 import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionUI;
@@ -48,6 +49,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ILineTracker;
 import org.eclipse.jface.text.IRegion;
@@ -498,18 +500,28 @@ public class PHPUnitEditor extends PHPEditor { //implements
       return super.requestWidgetToken(requester);
     }
 
-    /*
-     * @see org.eclipse.jface.text.source.ISourceViewer#configure(org.eclipse.jface.text.source.SourceViewerConfiguration)
-     */
+//    /*
+//     * @see org.eclipse.jface.text.source.ISourceViewer#configure(org.eclipse.jface.text.source.SourceViewerConfiguration)
+//     */
+//    public void configure(SourceViewerConfiguration configuration) {
+//      super.configure(configuration);
+//      //                             fCorrectionAssistant= new
+//      // JavaCorrectionAssistant(CompilationUnitEditor.this);
+//      //                             fCorrectionAssistant.install(this);
+//      //TODO install SmartBracesAutoEditStrategy
+//      //                             prependAutoEditStrategy(new SmartBracesAutoEditStrategy(this),
+//      // IDocument.DEFAULT_CONTENT_TYPE);
+//    }
     public void configure(SourceViewerConfiguration configuration) {
-      super.configure(configuration);
-      //                               fCorrectionAssistant= new
-      // JavaCorrectionAssistant(CompilationUnitEditor.this);
-      //                               fCorrectionAssistant.install(this);
-      //TODO install SmartBracesAutoEditStrategy
-      //                               prependAutoEditStrategy(new SmartBracesAutoEditStrategy(this),
-      // IDocument.DEFAULT_CONTENT_TYPE);
-    }
+               super.configure(configuration);
+//             fCorrectionAssistant= new JavaCorrectionAssistant(CompilationUnitEditor.this);
+//             fCorrectionAssistant.install(this);
+               IAutoEditStrategy smartSemi= new SmartSemicolonAutoEditStrategy(IPHPPartitions.PHP_PARTITIONING);
+               prependAutoEditStrategy(smartSemi, IDocument.DEFAULT_CONTENT_TYPE);
+               prependAutoEditStrategy(smartSemi, IPHPPartitions.PHP_STRING_DQ);
+               prependAutoEditStrategy(smartSemi, IPHPPartitions.PHP_STRING_SQ);
+//             prependAutoEditStrategy(smartSemi, IPHPPartitions.JAVA_CHARACTER);
+       }
   };
   /**
         * Remembers data related to the current selection to be able to