EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.resource.editors]

COVERAGE SUMMARY FOR SOURCE FILE [XMLConfiguration.java]

nameclass, %method, %block, %line, %
XMLConfiguration.java0%   (0/1)0%   (0/6)0%   (0/137)0%   (0/39)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class XMLConfiguration0%   (0/1)0%   (0/6)0%   (0/137)0%   (0/39)
XMLConfiguration (ColorManager): void 0%   (0/1)0%   (0/6)0%   (0/3)
getConfiguredContentTypes (ISourceViewer): String [] 0%   (0/1)0%   (0/15)0%   (0/4)
getDoubleClickStrategy (ISourceViewer, String): ITextDoubleClickStrategy 0%   (0/1)0%   (0/11)0%   (0/3)
getPresentationReconciler (ISourceViewer): IPresentationReconciler 0%   (0/1)0%   (0/53)0%   (0/15)
getXMLScanner (): XMLScanner 0%   (0/1)0%   (0/26)0%   (0/7)
getXMLTagScanner (): XMLTagScanner 0%   (0/1)0%   (0/26)0%   (0/7)

1package de.uka.ipd.sdq.pcm.gmf.resource.editors;
2 
3import org.eclipse.jface.text.IDocument;
4import org.eclipse.jface.text.ITextDoubleClickStrategy;
5import org.eclipse.jface.text.TextAttribute;
6import org.eclipse.jface.text.presentation.IPresentationReconciler;
7import org.eclipse.jface.text.presentation.PresentationReconciler;
8import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
9import org.eclipse.jface.text.rules.Token;
10import org.eclipse.jface.text.source.ISourceViewer;
11import org.eclipse.jface.text.source.SourceViewerConfiguration;
12 
13public class XMLConfiguration extends SourceViewerConfiguration {
14        private XMLDoubleClickStrategy doubleClickStrategy;
15        private XMLTagScanner tagScanner;
16        private XMLScanner scanner;
17        private ColorManager colorManager;
18 
19        public XMLConfiguration(ColorManager colorManager) {
20                this.colorManager = colorManager;
21        }
22        public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
23                return new String[] {
24                        IDocument.DEFAULT_CONTENT_TYPE,
25                        XMLPartitionScanner.XML_COMMENT,
26                        XMLPartitionScanner.XML_TAG };
27        }
28        public ITextDoubleClickStrategy getDoubleClickStrategy(
29                ISourceViewer sourceViewer,
30                String contentType) {
31                if (doubleClickStrategy == null)
32                        doubleClickStrategy = new XMLDoubleClickStrategy();
33                return doubleClickStrategy;
34        }
35 
36        protected XMLScanner getXMLScanner() {
37                if (scanner == null) {
38                        scanner = new XMLScanner(colorManager);
39                        scanner.setDefaultReturnToken(
40                                new Token(
41                                        new TextAttribute(
42                                                colorManager.getColor(IXMLColorConstants.DEFAULT))));
43                }
44                return scanner;
45        }
46        protected XMLTagScanner getXMLTagScanner() {
47                if (tagScanner == null) {
48                        tagScanner = new XMLTagScanner(colorManager);
49                        tagScanner.setDefaultReturnToken(
50                                new Token(
51                                        new TextAttribute(
52                                                colorManager.getColor(IXMLColorConstants.TAG))));
53                }
54                return tagScanner;
55        }
56 
57        public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
58                PresentationReconciler reconciler = new PresentationReconciler();
59 
60                DefaultDamagerRepairer dr =
61                        new DefaultDamagerRepairer(getXMLTagScanner());
62                reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG);
63                reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG);
64 
65                dr = new DefaultDamagerRepairer(getXMLScanner());
66                reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
67                reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
68 
69                NonRuleBasedDamagerRepairer ndr =
70                        new NonRuleBasedDamagerRepairer(
71                                new TextAttribute(
72                                        colorManager.getColor(IXMLColorConstants.XML_COMMENT)));
73                reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
74                reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);
75 
76                return reconciler;
77        }
78 
79}

[all classes][de.uka.ipd.sdq.pcm.gmf.resource.editors]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov