Klaus Hartlage - www.eclipseproject.de
**********************************************************************/
+import net.sourceforge.phpdt.internal.ui.text.JavaColorManager;
+import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCodeScanner;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.phpeditor.php.HTMLCodeScanner;
import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner;
-import net.sourceforge.phpeclipse.phpeditor.php.HTMLCodeScanner;
import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
/** The PHPEditorEnvironment maintains singletons used by the php editor
*/
public class PHPEditorEnvironment {
-
- private static PHPColorProvider fgColorProvider;
- private static PHPCodeScanner fgCodeScanner;
+ // PHPColorProvider
+ private static JavaColorManager fgColorProvider;
+ private static PHPCodeScanner fgPHPCodeScanner;
private static HTMLCodeScanner fgHTMLCodeScanner;
- //private static JavaDocScanner fgDocScanner;
+ private static PHPDocCodeScanner fgDocScanner;
private static int fgRefCount = 0;
*/
public static void connect(Object client) {
if (++fgRefCount == 1) {
- fgColorProvider = new PHPColorProvider();
- fgCodeScanner = new PHPCodeScanner(fgColorProvider);
- fgHTMLCodeScanner = new HTMLCodeScanner(fgColorProvider);
- // fgDocScanner= new JavaDocScanner(fgColorProvider);
+ fgColorProvider = new JavaColorManager(); // new PHPColorProvider();
+ fgPHPCodeScanner = new PHPCodeScanner(fgColorProvider, PHPeclipsePlugin.getDefault().getPreferenceStore() );
+ fgHTMLCodeScanner = new HTMLCodeScanner(fgColorProvider, PHPeclipsePlugin.getDefault().getPreferenceStore());
+ fgDocScanner = new PHPDocCodeScanner(fgColorProvider, PHPeclipsePlugin.getDefault().getPreferenceStore() );
}
}
*/
public static void disconnect(Object client) {
if (--fgRefCount == 0) {
- fgCodeScanner = null;
+ fgPHPCodeScanner = null;
fgHTMLCodeScanner = null;
- // fgDocScanner= null;
+ fgDocScanner = null;
fgColorProvider.dispose();
fgColorProvider = null;
}
* Returns the singleton scanner.
*/
public static PHPCodeScanner getPHPCodeScanner() {
- return fgCodeScanner;
+ return fgPHPCodeScanner;
}
+ /**
+ * Returns the singleton scanner.
+ */
public static HTMLCodeScanner getHTMLCodeScanner() {
return fgHTMLCodeScanner;
}
/**
- * Returns the singleton color provider.
+ * Returns the singleton PHPDoc scanner.
*/
- public static PHPColorProvider getPHPColorProvider() {
- return fgColorProvider;
+ public static PHPDocCodeScanner getPHPDocCodeScanner() {
+ return fgDocScanner;
}
/**
- * Returns the singleton document scanner.
+ * Returns the singleton color provider.
*/
- // public static RuleBasedScanner getJavaDocScanner() {
- // return fgDocScanner;
- // }
+ public static JavaColorManager getPHPColorProvider() {
+ return fgColorProvider;
+ }
+
}