Updated build.properties, build.xml for release build
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPUnitEditor.java
index a7cc596..0a2fd89 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;
@@ -28,6 +29,7 @@ import net.sourceforge.phpdt.ui.PreferenceConstants;
 import net.sourceforge.phpdt.ui.actions.GenerateActionGroup;
 import net.sourceforge.phpdt.ui.text.JavaTextTools;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction;
 
 import org.eclipse.core.internal.runtime.ListenerList;
 import org.eclipse.core.resources.IFile;
@@ -48,6 +50,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 +501,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
@@ -2229,10 +2242,6 @@ public class PHPUnitEditor extends PHPEditor { //implements
       } else
         performSave(false, progressMonitor);
     }
-    ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance();
-    if (a != null) {
-      a.refresh();
-    }
   }
 
   public boolean isSaveAsAllowed() {
@@ -2703,4 +2712,14 @@ public class PHPUnitEditor extends PHPEditor { //implements
                return fReconcilerLock;
        }
        
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorSaved()
+   */
+  protected void editorSaved() {
+    super.editorSaved();
+    ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance();
+    if (a != null) {
+      a.refresh(ShowExternalPreviewAction.PHP_TYPE);
+    }
+  }
 }
\ No newline at end of file