import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
-public class PHPConfiguration extends SourceViewerConfiguration {
- private PHPDoubleClickStrategy doubleClickStrategy;
- private PHPTagScanner tagScanner;
+public class PHPConfiguration extends SourceViewerConfiguration
+{
private PHPScanner scanner;
private ColorManager colorManager;
- public PHPConfiguration(ColorManager colorManager) {
+ public PHPConfiguration(ColorManager colorManager)
+ {
this.colorManager = colorManager;
}
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer)
+ {
return new String[] {
IDocument.DEFAULT_CONTENT_TYPE,
PHPPartitionScanner.HTML_COMMENT,
PHPPartitionScanner.HTML_TAG };
}
- public ITextDoubleClickStrategy getDoubleClickStrategy(
- ISourceViewer sourceViewer,
- String contentType) {
- if (doubleClickStrategy == null)
- doubleClickStrategy = new PHPDoubleClickStrategy();
- return doubleClickStrategy;
- }
- protected PHPScanner getXMLScanner() {
- if (scanner == null) {
+ protected PHPScanner getXMLScanner()
+ {
+ if (scanner == null)
+ {
scanner = new PHPScanner(colorManager);
- scanner.setDefaultReturnToken(
- new Token(
- new TextAttribute(
- colorManager.getColor(IPHPColorConstants.DEFAULT))));
+ scanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IPHPColorConstants.DEFAULT))));
}
return scanner;
-
+
+
}
+
+
- protected PHPTagScanner getXMLTagScanner() {
- if (tagScanner == null) {
- tagScanner = new PHPTagScanner(colorManager);
- tagScanner.setDefaultReturnToken(
- new Token(
- new TextAttribute(
- colorManager.getColor(IPHPColorConstants.PHP_TAG))));
- }
- return tagScanner;
- }
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)
+ {
PresentationReconciler reconciler = new PresentationReconciler();
DefaultDamagerRepairer dr =
- new DefaultDamagerRepairer(getXMLTagScanner());
- reconciler.setDamager(dr, PHPPartitionScanner.HTML_TAG);
- reconciler.setRepairer(dr, PHPPartitionScanner.HTML_TAG);
-
- dr = new DefaultDamagerRepairer(getXMLScanner());
+ new DefaultDamagerRepairer(getXMLScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
- NonRuleBasedDamagerRepairer ndr =
- new NonRuleBasedDamagerRepairer(
- new TextAttribute(
- colorManager.getColor(IPHPColorConstants.XML_COMMENT)));
- reconciler.setDamager(ndr, PHPPartitionScanner.HTML_COMMENT);
- reconciler.setRepairer(ndr, PHPPartitionScanner.HTML_COMMENT);
-
return reconciler;
}
+
+
+
+
+}
-}
\ No newline at end of file