added file extension php5
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / ui / text / JavaTextTools.java
index 5c025c8..0d592a8 100644 (file)
@@ -47,7 +47,6 @@ import org.eclipse.ui.part.FileEditorInput;
 public class JavaTextTools {
 
   private static PHPPartitionScanner HTML_PARTITION_SCANNER = null;
-
   private static PHPPartitionScanner PHP_PARTITION_SCANNER = null;
   private static PHPPartitionScanner SMARTY_PARTITION_SCANNER = null;
 
@@ -119,23 +118,37 @@ public class JavaTextTools {
    * @see org.phpeclipse.phpdt.ui.PreferenceConstants#getPreferenceStore()
    * @since 2.0
    */
-  public JavaTextTools(IPreferenceStore store) {
-    fPreferenceStore = store;
-    fPreferenceStore.addPropertyChangeListener(fPreferenceListener);
-
-    fColorManager = new JavaColorManager();
-    fCodeScanner = new PHPCodeScanner(fColorManager, store);
-    fMultilineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_MULTILINE_COMMENT);
-    fSinglelineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_SINGLELINE_COMMENT);
-    fStringScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_STRING);
-    fPHPDocScanner = new PHPDocCodeScanner(fColorManager, store);
-    fHTMLScanner = new HTMLCodeScanner(fColorManager, store);
-    fSmartyScanner = new SmartyCodeScanner(fColorManager, store);
-    fSmartyDocScanner = new SmartyDocCodeScanner(fColorManager, store);
-//    fPartitionScanner = new FastJavaPartitionScanner();
-    fPartitionScanner = new PHPPartitionScanner();
-  }
-
+//  public JavaTextTools(IPreferenceStore store) {
+//    fPreferenceStore = store;
+//    fPreferenceStore.addPropertyChangeListener(fPreferenceListener);
+//
+//    fColorManager = new JavaColorManager();
+//    fCodeScanner = new PHPCodeScanner(fColorManager, store);
+//    fMultilineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_MULTILINE_COMMENT);
+//    fSinglelineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_SINGLELINE_COMMENT);
+//    fStringScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_STRING);
+//    fPHPDocScanner = new PHPDocCodeScanner(fColorManager, store);
+//    fHTMLScanner = new HTMLCodeScanner(fColorManager, store);
+//    fSmartyScanner = new SmartyCodeScanner(fColorManager, store);
+//    fSmartyDocScanner = new SmartyDocCodeScanner(fColorManager, store);
+////    fPartitionScanner = new FastJavaPartitionScanner();
+//    fPartitionScanner = new PHPPartitionScanner();
+//  }
+  /**
+        * Creates a new Java text tools collection.
+        * @param store the preference store to initialize the text tools. The text tool
+        *                      instance installs a listener on the passed preference store to adapt itself to 
+        *                      changes in the preference store. In general <code>PreferenceConstants.
+        *                      getPreferenceStore()</code> should be used to initialize the text tools.
+        * @param coreStore optional preference store to initialize the text tools. The text tool
+        *                      instance installs a listener on the passed preference store to adapt itself to 
+        *                      changes in the preference store.
+        * @see org.eclipse.jdt.ui.PreferenceConstants#getPreferenceStore()
+        * @since 2.1
+        */
+       public JavaTextTools(IPreferenceStore store, Preferences coreStore) {
+               this(store, coreStore, true);
+       }
   /**
    * Creates a new Java text tools collection.
    * 
@@ -161,6 +174,7 @@ public class JavaTextTools {
       fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener);
 
     fColorManager = new JavaColorManager(autoDisposeOnDisplayDispose);
+    
     fCodeScanner = new PHPCodeScanner(fColorManager, store);
     fMultilineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_MULTILINE_COMMENT);
     fSinglelineCommentScanner = new SingleTokenPHPScanner(fColorManager, store, IPreferenceConstants.PHP_SINGLELINE_COMMENT);
@@ -463,6 +477,12 @@ public class JavaTextTools {
       fStringScanner.adaptToPreferenceChange(event);
     if (fPHPDocScanner.affectsBehavior(event))
       fPHPDocScanner.adaptToPreferenceChange(event);
+    if (fHTMLScanner.affectsBehavior(event))
+      fHTMLScanner.adaptToPreferenceChange(event);
+    if (fSmartyScanner.affectsBehavior(event))
+      fSmartyScanner.adaptToPreferenceChange(event);
+    if (fSmartyDocScanner.affectsBehavior(event))
+      fSmartyDocScanner.adaptToPreferenceChange(event);
   }
 
   /**