public class JavaTextTools {
private static PHPPartitionScanner HTML_PARTITION_SCANNER = null;
-
private static PHPPartitionScanner PHP_PARTITION_SCANNER = null;
private static PHPPartitionScanner SMARTY_PARTITION_SCANNER = null;
* @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.
*
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);
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);
}
/**