little bugfixes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / ui / text / JavaTextTools.java
index b3073f1..4b5d76d 100644 (file)
@@ -8,6 +8,7 @@ package net.sourceforge.phpdt.ui.text;
 import net.sourceforge.phpdt.internal.ui.text.FastJavaPartitionScanner;
 import net.sourceforge.phpdt.internal.ui.text.JavaColorManager;
 import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCodeScanner;
+import net.sourceforge.phpeclipse.phpeditor.php.HTMLCodeScanner;
 import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner;
 
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -45,16 +46,18 @@ public class JavaTextTools {
                
        /** The color manager */
        private JavaColorManager fColorManager;
-       /** The Java source code scanner */
+       /** The PHP source code scanner */
        private PHPCodeScanner fCodeScanner;
-       /** The Java multiline comment scanner */
+       /** The PHP multiline comment scanner */
        private SingleTokenPHPScanner fMultilineCommentScanner;
        /** The Java singleline comment scanner */
        private SingleTokenPHPScanner fSinglelineCommentScanner;
        /** The Java string scanner */
        private SingleTokenPHPScanner fStringScanner;
-       /** The JavaDoc scanner */
+       /** The PHPDoc scanner */
        private PHPDocCodeScanner fJavaDocScanner;
+  /** The HTML scanner */
+  private HTMLCodeScanner fHTMLScanner;
        /** The Java partitions scanner */
        private FastJavaPartitionScanner fPartitionScanner;     
        
@@ -81,10 +84,11 @@ public class JavaTextTools {
                
                fColorManager= new JavaColorManager();
                fCodeScanner= new PHPCodeScanner(fColorManager, store);
-               fMultilineCommentScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT);
-               fSinglelineCommentScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT);
-               fStringScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.JAVA_STRING);
+               fMultilineCommentScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.PHP_MULTI_LINE_COMMENT);
+               fSinglelineCommentScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.PHP_SINGLE_LINE_COMMENT);
+               fStringScanner= new SingleTokenPHPScanner(fColorManager, store, IJavaColorConstants.PHP_STRING);
                fJavaDocScanner= new PHPDocCodeScanner(fColorManager, store);
+    fHTMLScanner= new HTMLCodeScanner(fColorManager, store);
                fPartitionScanner= new FastJavaPartitionScanner();
        }
        
@@ -142,6 +146,17 @@ public class JavaTextTools {
                return fMultilineCommentScanner;
        }
 
+  /**
+   * Returns a scanner which is configured to scan HTML code.
+   *
+   * @return a HTML scanner
+   * 
+   * @since 2.0
+   */
+  public RuleBasedScanner getHTMLScanner() {
+    return fHTMLScanner;
+  } 
+  
        /**
         * Returns a scanner which is configured to scan Java singleline comments.
         *
@@ -228,11 +243,11 @@ public class JavaTextTools {
         * @since 2.0
         */
        public boolean affectsBehavior(PropertyChangeEvent event) {
-               return // fCodeScanner.affectsBehavior(event) ||
+               return fCodeScanner.affectsBehavior(event) ||
                                        fMultilineCommentScanner.affectsBehavior(event) ||
                                        fSinglelineCommentScanner.affectsBehavior(event) ||
-                                       fStringScanner.affectsBehavior(event); // ||
-//                                     fJavaDocScanner.affectsBehavior(event);
+                                       fStringScanner.affectsBehavior(event) ||
+                                       fJavaDocScanner.affectsBehavior(event);
        }
        
        /**
@@ -243,15 +258,15 @@ public class JavaTextTools {
         * @since 2.0
         */
        protected void adaptToPreferenceChange(PropertyChangeEvent event) {
-//             if (fCodeScanner.affectsBehavior(event))
-//                     fCodeScanner.adaptToPreferenceChange(event);
+               if (fCodeScanner.affectsBehavior(event))
+                       fCodeScanner.adaptToPreferenceChange(event);
                if (fMultilineCommentScanner.affectsBehavior(event))
                        fMultilineCommentScanner.adaptToPreferenceChange(event);
                if (fSinglelineCommentScanner.affectsBehavior(event))
                        fSinglelineCommentScanner.adaptToPreferenceChange(event);
                if (fStringScanner.affectsBehavior(event))
                        fStringScanner.adaptToPreferenceChange(event);
-//             if (fJavaDocScanner.affectsBehavior(event))
-//                     fJavaDocScanner.adaptToPreferenceChange(event);
+               if (fJavaDocScanner.affectsBehavior(event))
+                       fJavaDocScanner.adaptToPreferenceChange(event);
        }
 }
\ No newline at end of file