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;
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;
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;
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
} else
performSave(false, progressMonitor);
}
- ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance();
- if (a != null) {
- a.refresh();
- }
}
public boolean isSaveAsAllowed() {
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