X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/JavaTextTools.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/JavaTextTools.java index fb386ab..acb7427 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/JavaTextTools.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/JavaTextTools.java @@ -10,15 +10,13 @@ import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions; import net.sourceforge.phpdt.internal.ui.text.JavaColorManager; import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCodeScanner; import net.sourceforge.phpeclipse.IPreferenceConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.phpeditor.php.HTMLPartitionScanner; +import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner; import net.sourceforge.phpeclipse.phpeditor.php.PHPDocumentPartitioner; import net.sourceforge.phpeclipse.phpeditor.php.PHPPartitionScanner; -import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner; import net.sourceforge.phpeclipse.phpeditor.php.SmartyCodeScanner; import net.sourceforge.phpeclipse.phpeditor.php.SmartyDocCodeScanner; import net.sourceforge.phpeclipse.xml.ui.XMLPlugin; -import net.sourceforge.phpeclipse.xml.ui.internal.text.SingleTokenScanner; import net.sourceforge.phpeclipse.xml.ui.internal.text.XMLPartitionScanner; import net.sourceforge.phpeclipse.xml.ui.text.XMLTextTools; @@ -28,9 +26,7 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentExtension3; import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.jface.text.rules.DefaultPartitioner; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.text.rules.Token; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; @@ -106,9 +102,12 @@ public class JavaTextTools implements IPHPPartitions { /** The Java singleline comment scanner */ private SingleTokenPHPScanner fSinglelineCommentScanner; - /** The Java string scanner */ - private SingleTokenPHPScanner fStringScanner; + /** The PHP double quoted string scanner */ +// private SingleTokenPHPScanner fStringDQScanner; + /** The PHP single quoted string scanner */ +// private SingleTokenPHPScanner fStringSQScanner; + /** The PHPDoc scanner */ private PHPDocCodeScanner fPHPDocScanner; @@ -159,7 +158,7 @@ public class JavaTextTools implements IPHPPartitions { * @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() + * @see net.sourceforge.phpdt.ui.PreferenceConstants#getPreferenceStore() * @since 2.1 */ public JavaTextTools(IPreferenceStore store, Preferences coreStore) { @@ -180,7 +179,7 @@ public class JavaTextTools implements IPHPPartitions { * @param autoDisposeOnDisplayDispose * if true the color manager automatically disposes all managed colors when the current display gets * disposed and all calls to {@link org.eclipse.jface.text.source.ISharedTextColors#dispose()}are ignored. - * @see org.eclipse.jdt.ui.PreferenceConstants#getPreferenceStore() + * @see net.sourceforge.phpdt.ui.PreferenceConstants#getPreferenceStore() * @since 2.1 */ public JavaTextTools(IPreferenceStore store, Preferences coreStore, boolean autoDisposeOnDisplayDispose) { @@ -201,7 +200,9 @@ public class JavaTextTools implements IPHPPartitions { IPreferenceConstants.PHP_MULTILINE_COMMENT); fSinglelineCommentScanner = new SingleTokenPHPScanner((JavaColorManager) colorManager, store, IPreferenceConstants.PHP_SINGLELINE_COMMENT); - fStringScanner = new SingleTokenPHPScanner((JavaColorManager) colorManager, store, IPreferenceConstants.PHP_STRING); +// fStringDQScanner = new SingleTokenPHPScanner((JavaColorManager) colorManager, store, IPreferenceConstants.PHP_STRING); +// fStringSQScanner = new SingleTokenPHPScanner((JavaColorManager) colorManager, store, IPreferenceConstants.PHP_STRING); + fPHPDocScanner = new PHPDocCodeScanner((JavaColorManager) colorManager, store); // fHTMLScanner = new HTMLCodeScanner((JavaColorManager)fColorManager, store); fSmartyScanner = new SmartyCodeScanner((JavaColorManager) colorManager, store); @@ -234,7 +235,8 @@ public class JavaTextTools implements IPHPPartitions { fCodeScanner = null; fMultilineCommentScanner = null; fSinglelineCommentScanner = null; - fStringScanner = null; +// fStringDQScanner = null; +// fStringSQScanner = null; fPHPDocScanner = null; // fPartitionScanner = null; @@ -335,9 +337,9 @@ public class JavaTextTools implements IPHPPartitions { * * @since 2.0 */ - public RuleBasedScanner getStringScanner() { - return fStringScanner; - } +// public RuleBasedScanner getStringScanner() { +// return fStringDQScanner; +// } /** * Returns a scanner which is configured to scan JavaDoc compliant comments. Notes that the start sequence "/**" and the @@ -479,13 +481,13 @@ public class JavaTextTools implements IPHPPartitions { * @return true if event causes a behavioral change * @since 2.0 * @deprecated As of 3.0, replaced by - * {@link org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration#affectsTextPresentation(PropertyChangeEvent)} + * {@link net.sourceforge.phpdt.ui.text.JavaSourceViewerConfiguration#affectsTextPresentation(PropertyChangeEvent)} */ // public boolean affectsBehavior(PropertyChangeEvent event) { // return fCodeScanner.affectsBehavior(event) // || fMultilineCommentScanner.affectsBehavior(event) // || fSinglelineCommentScanner.affectsBehavior(event) - // || fStringScanner.affectsBehavior(event) + // || fStringDQScanner.affectsBehavior(event) // || fPHPDocScanner.affectsBehavior(event); // } /** @@ -502,8 +504,8 @@ public class JavaTextTools implements IPHPPartitions { fMultilineCommentScanner.adaptToPreferenceChange(event); if (fSinglelineCommentScanner.affectsBehavior(event)) fSinglelineCommentScanner.adaptToPreferenceChange(event); - // if (fStringScanner.affectsBehavior(event)) - // fStringScanner.adaptToPreferenceChange(event); + // if (fStringDQScanner.affectsBehavior(event)) + // fStringDQScanner.adaptToPreferenceChange(event); if (fPHPDocScanner.affectsBehavior(event)) fPHPDocScanner.adaptToPreferenceChange(event); // if (fHTMLScanner.affectsBehavior(event)) @@ -544,7 +546,7 @@ public class JavaTextTools implements IPHPPartitions { } private IDocumentPartitioner createJSPPartitioner() { - return new PHPDocumentPartitioner(getJSPPartitionScanner(), getPHPPartitionScanner()); + return new PHPDocumentPartitioner(getJSPPartitionScanner()); // return new JSPDocumentPartitioner(getJSPPartitionScanner(), jspScriptScanner); } @@ -616,14 +618,14 @@ public class JavaTextTools implements IPHPPartitions { /** * Return a scanner for creating xml partitions. */ - private static XMLPartitionScanner getXMLPartitionScanner() { - // if (XML_PARTITION_SCANNER == null) - // XML_PARTITION_SCANNER = new HTMLPartitionScanner(IPHPPartitions.XML_FILE); - // return XML_PARTITION_SCANNER; - if (XML_PARTITION_SCANNER == null) - XML_PARTITION_SCANNER = new XMLPartitionScanner(false); - return XML_PARTITION_SCANNER; - } +// private static XMLPartitionScanner getXMLPartitionScanner() { +// // if (XML_PARTITION_SCANNER == null) +// // XML_PARTITION_SCANNER = new HTMLPartitionScanner(IPHPPartitions.XML_FILE); +// // return XML_PARTITION_SCANNER; +// if (XML_PARTITION_SCANNER == null) +// XML_PARTITION_SCANNER = new XMLPartitionScanner(false); +// return XML_PARTITION_SCANNER; +// } private PHPPartitionScanner getJSPPartitionScanner() { if (jspPartitionScanner == null)