blob: a0d8516271d394075841b052b59a644e9a9d973e [file] [log] [blame]
<HTML><HEAD><META CONTENT="text/html; charset=UTF-8" HTTP-EQUIV="Content-Type"/><TITLE>EMMA Coverage Report</TITLE><STYLE TYPE="text/css"> TABLE,TD,TH {border-style:solid; border-color:black;} TD,TH {background:white;margin:0;line-height:100%;padding-left:0.5em;padding-right:0.5em;} TD {border-width:0 1px 0 0;} TH {border-width:1px 1px 1px 0;} TR TD.h {color:red;} TABLE {border-spacing:0; border-collapse:collapse;border-width:0 0 1px 1px;} P,H1,H2,H3,TH {font-family:verdana,arial,sans-serif;font-size:10pt;} TD {font-family:courier,monospace;font-size:10pt;} TABLE.hdft {border-spacing:0;border-collapse:collapse;border-style:none;} TABLE.hdft TH,TABLE.hdft TD {border-style:none;line-height:normal;} TABLE.hdft TH.tl,TABLE.hdft TD.tl {background:#6699CC;color:white;} TABLE.hdft TD.nv {background:#6633DD;color:white;} .nv A:link {color:white;} .nv A:visited {color:white;} .nv A:active {color:yellow;} TABLE.hdft A:link {color:white;} TABLE.hdft A:visited {color:white;} TABLE.hdft A:active {color:yellow;} .in {color:#356085;} TABLE.s TD {padding-left:0.25em;padding-right:0.25em;} TABLE.s TD.l {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#F0F0F0;} TABLE.s TR.z TD {background:#FF9999;} TABLE.s TR.p TD {background:#FFFF88;} TABLE.s TR.c TD {background:#CCFFCC;} A:link {color:#0000EE;text-decoration:none;} A:visited {color:#0000EE;text-decoration:none;} A:hover {color:#0000EE;text-decoration:underline;} TABLE.cn {border-width:0 0 1px 0;} TABLE.s {border-width:1px 0 1px 1px;} TD.h {color:red;border-width:0 1px 0 0;} TD.f {border-width:0 1px 0 1px;} TD.hf {color:red;border-width:0 1px 0 1px;} TH.f {border-width:1px 1px 1px 1px;} TR.cis TD {background:#F0F0F0;} TR.cis TD {border-width:1px 1px 1px 0;} TR.cis TD.h {color:red;border-width:1px 1px 1px 0;} TR.cis TD.f {border-width:1px 1px 1px 1px;} TR.cis TD.hf {color:red;border-width:1px 1px 1px 1px;} TD.b {border-style:none;background:transparent;line-height:50%;} TD.bt {border-width:1px 0 0 0;background:transparent;line-height:50%;} TR.o TD {background:#F0F0F0;}TABLE.it {border-style:none;}TABLE.it TD,TABLE.it TH {border-style:none;}</STYLE></HEAD><BODY><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="tl"><A HREF="http://www.eclemma.org/">EMMA</A> Coverage Report (generated Fri Feb 20 18:44:54 GMT 2009)</TH></TR><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="8e.html">org.eclipse.wst.xsl.ui.internal</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">StructuredTextViewerConfigurationXSL.java</SPAN>]</H2><TABLE CELLSPACING="0" WIDTH="100%"><TR><TH>name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD>StructuredTextViewerConfigurationXSL.java</TD><TD>100% (1/1)</TD><TD>100% (7/7)</TD><TD>99%  (167/169)</TD><TD>98%  (43/44)</TD></TR></TABLE><H3>COVERAGE BREAKDOWN BY CLASS AND METHOD</H3><TABLE CLASS="cn" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="f">name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#0">StructuredTextViewerConfigurationXSL</A></TD><TD>100% (1/1)</TD><TD>100% (7/7)</TD><TD>99%  (167/169)</TD><TD>98%  (43/44)</TD></TR><TR><TD CLASS="f"><A HREF="#1">getHyperlinkDetectors (ISourceViewer): IHyperlinkDetector []</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>94%  (32/34)</TD><TD>91%  (10/11)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#0">StructuredTextViewerConfigurationXSL (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (3/3)</TD><TD>100% (2/2)</TD></TR><TR><TD CLASS="f"><A HREF="#3">getConfiguredContentTypes (ISourceViewer): String []</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (36/36)</TD><TD>100% (10/10)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#4">getContentAssistProcessors (ISourceViewer, String): IContentAssistProcessor []</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (40/40)</TD><TD>100% (8/8)</TD></TR><TR><TD CLASS="f"><A HREF="#5">getLineStyleProviderForXSL (): LineStyleProvider</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (11/11)</TD><TD>100% (3/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#6">getLineStyleProviders (ISourceViewer, String): LineStyleProvider []</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (17/17)</TD><TD>100% (4/4)</TD></TR><TR><TD CLASS="f"><A HREF="#7">isXMLPartition (String): boolean</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (28/28)</TD><TD>100% (6/6)</TD></TR></TABLE><P></P><TABLE CLASS="s" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="l">1</TD><TD>/*******************************************************************************</TD></TR><TR><TD CLASS="l">2</TD><TD> * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.</TD></TR><TR><TD CLASS="l">3</TD><TD> * All rights reserved. This program and the accompanying materials</TD></TR><TR><TD CLASS="l">4</TD><TD> * are made available under the terms of the Eclipse Public License v1.0</TD></TR><TR><TD CLASS="l">5</TD><TD> * which accompanies this distribution, and is available at</TD></TR><TR><TD CLASS="l">6</TD><TD> * http://www.eclipse.org/legal/epl-v10.html</TD></TR><TR><TD CLASS="l">7</TD><TD> *</TD></TR><TR><TD CLASS="l">8</TD><TD> * Contributors:</TD></TR><TR><TD CLASS="l">9</TD><TD> *     David Carver - STAR - bug 213849 - initial API and implementation</TD></TR><TR><TD CLASS="l">10</TD><TD> *******************************************************************************/</TD></TR><TR><TD CLASS="l">11</TD><TD> </TD></TR><TR><TD CLASS="l">12</TD><TD>package org.eclipse.wst.xsl.ui.internal;</TD></TR><TR><TD CLASS="l">13</TD><TD> </TD></TR><TR><TD CLASS="l">14</TD><TD>import org.eclipse.jface.text.contentassist.IContentAssistProcessor;</TD></TR><TR><TD CLASS="l">15</TD><TD>import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;</TD></TR><TR><TD CLASS="l">16</TD><TD>import org.eclipse.jface.text.source.ISourceViewer;</TD></TR><TR><TD CLASS="l">17</TD><TD>import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;</TD></TR><TR><TD CLASS="l">18</TD><TD>import org.eclipse.wst.sse.core.text.IStructuredPartitions;</TD></TR><TR><TD CLASS="l">19</TD><TD>import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider; // import</TD></TR><TR><TD CLASS="l">20</TD><TD>                                                                                                                                                        // org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;</TD></TR><TR><TD CLASS="l">21</TD><TD>import org.eclipse.wst.xml.core.text.IXMLPartitions;</TD></TR><TR><TD CLASS="l">22</TD><TD>import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;</TD></TR><TR><TD CLASS="l">23</TD><TD>import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;</TD></TR><TR><TD CLASS="l">24</TD><TD>import org.eclipse.wst.xsl.core.internal.text.IXSLPartitions;</TD></TR><TR><TD CLASS="l">25</TD><TD>import org.eclipse.wst.xsl.core.internal.text.rules.StructuredTextPartitionerForXSL;</TD></TR><TR><TD CLASS="l">26</TD><TD>import org.eclipse.wst.xsl.ui.internal.contentassist.XSLContentAssistProcessor;</TD></TR><TR><TD CLASS="l">27</TD><TD>import org.eclipse.wst.xsl.ui.internal.editor.XSLHyperlinkDetector;</TD></TR><TR><TD CLASS="l">28</TD><TD>import org.eclipse.wst.xsl.ui.internal.style.LineStyleProviderForXSL;</TD></TR><TR><TD CLASS="l">29</TD><TD> </TD></TR><TR><TD CLASS="l">30</TD><TD>/**</TD></TR><TR><TD CLASS="l">31</TD><TD> * StructuredTextViewerConfigurationXSL implements content assistance for</TD></TR><TR><TD CLASS="l">32</TD><TD> * attributes and other XPath related functionality.</TD></TR><TR><TD CLASS="l">33</TD><TD> * </TD></TR><TR><TD CLASS="l">34</TD><TD> * @author dcarver</TD></TR><TR><TD CLASS="l">35</TD><TD> * </TD></TR><TR><TD CLASS="l">36</TD><TD> */</TD></TR><TR><TD CLASS="l">37</TD><TD>public class StructuredTextViewerConfigurationXSL extends</TD></TR><TR><TD CLASS="l">38</TD><TD>                StructuredTextViewerConfigurationXML {</TD></TR><TR><TD CLASS="l">39</TD><TD> </TD></TR><TR><TD CLASS="l">40</TD><TD>        private String[] fConfiguredContentTypes;</TD></TR><TR><TD CLASS="l">41</TD><TD>        private LineStyleProvider fLineStyleProviderForXSL;</TD></TR><TR><TD CLASS="l">42</TD><TD>//        private LineStyleProvider fLineStyleProviderForXML;</TD></TR><TR><TD CLASS="l">43</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="0">44</A></TD><TD>        /**</TD></TR><TR><TD CLASS="l">45</TD><TD>         * Configuration for XSL Content Types</TD></TR><TR><TD CLASS="l">46</TD><TD>         */</TD></TR><TR><TD CLASS="l">47</TD><TD>        public StructuredTextViewerConfigurationXSL() {</TD></TR><TR CLASS="c"><TD CLASS="l">48</TD><TD>                super();</TD></TR><TR CLASS="c"><TD CLASS="l">49</TD><TD>        }</TD></TR><TR><TD CLASS="l">50</TD><TD> </TD></TR><TR><TD CLASS="l">51</TD><TD>        /**</TD></TR><TR><TD CLASS="l">52</TD><TD>         * Return the processors for the current content type.</TD></TR><TR><TD CLASS="l"><A NAME="4">53</A></TD><TD>         */</TD></TR><TR><TD CLASS="l">54</TD><TD>        @Override</TD></TR><TR><TD CLASS="l">55</TD><TD>        protected IContentAssistProcessor[] getContentAssistProcessors(</TD></TR><TR><TD CLASS="l">56</TD><TD>                        ISourceViewer sourceViewer, String partitionType) {</TD></TR><TR CLASS="c"><TD CLASS="l">57</TD><TD>                IContentAssistProcessor[] processors = null;</TD></TR><TR><TD CLASS="l">58</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">59</TD><TD>                if ((partitionType.equals(IStructuredPartitions.DEFAULT_PARTITION))</TD></TR><TR CLASS="c"><TD CLASS="l">60</TD><TD>                                || (partitionType.equals(IXMLPartitions.XML_DEFAULT))</TD></TR><TR CLASS="c"><TD CLASS="l">61</TD><TD>                                || (partitionType.equals(IXSLPartitions.XSL_XPATH))) {</TD></TR><TR CLASS="c"><TD CLASS="l">62</TD><TD>                        processors = new IContentAssistProcessor[] { new XSLContentAssistProcessor() };</TD></TR><TR CLASS="c"><TD CLASS="l">63</TD><TD>                } else if (partitionType.equals(IStructuredPartitions.UNKNOWN_PARTITION)) {</TD></TR><TR CLASS="c"><TD CLASS="l">64</TD><TD>                        processors = new IContentAssistProcessor[] { new NoRegionContentAssistProcessor() };</TD></TR><TR><TD CLASS="l">65</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">66</TD><TD>                return processors;</TD></TR><TR><TD CLASS="l">67</TD><TD>        }</TD></TR><TR><TD CLASS="l">68</TD><TD> </TD></TR><TR><TD CLASS="l">69</TD><TD>        /**</TD></TR><TR><TD CLASS="l">70</TD><TD>         * (non-Javadoc)</TD></TR><TR><TD CLASS="l">71</TD><TD>         * </TD></TR><TR><TD CLASS="l"><A NAME="1">72</A></TD><TD>         * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)</TD></TR><TR><TD CLASS="l">73</TD><TD>         */</TD></TR><TR><TD CLASS="l">74</TD><TD>        @Override</TD></TR><TR><TD CLASS="l">75</TD><TD>        public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {</TD></TR><TR CLASS="c"><TD CLASS="l">76</TD><TD>                if (sourceViewer == null</TD></TR><TR CLASS="c"><TD CLASS="l">77</TD><TD>                                || !fPreferenceStore</TD></TR><TR CLASS="c"><TD CLASS="l">78</TD><TD>                                                .getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))</TD></TR><TR CLASS="z"><TD CLASS="l">79</TD><TD>                        return null;</TD></TR><TR CLASS="c"><TD CLASS="l">80</TD><TD>                IHyperlinkDetector[] superDetectors = super</TD></TR><TR CLASS="c"><TD CLASS="l">81</TD><TD>                                .getHyperlinkDetectors(sourceViewer);</TD></TR><TR CLASS="c"><TD CLASS="l">82</TD><TD>                IHyperlinkDetector[] allDetectors = new IHyperlinkDetector[superDetectors.length + 1];</TD></TR><TR CLASS="c"><TD CLASS="l">83</TD><TD>                allDetectors[0] = new XSLHyperlinkDetector();</TD></TR><TR CLASS="c"><TD CLASS="l">84</TD><TD>                System.arraycopy(superDetectors, 0, allDetectors, 1,</TD></TR><TR CLASS="c"><TD CLASS="l">85</TD><TD>                                superDetectors.length);</TD></TR><TR CLASS="c"><TD CLASS="l">86</TD><TD>                return allDetectors;</TD></TR><TR><TD CLASS="l">87</TD><TD>        }</TD></TR><TR><TD CLASS="l">88</TD><TD> </TD></TR><TR><TD CLASS="l">89</TD><TD>        /**</TD></TR><TR><TD CLASS="l">90</TD><TD>         * (non-Javadoc)</TD></TR><TR><TD CLASS="l">91</TD><TD>         * </TD></TR><TR><TD CLASS="l"><A NAME="3">92</A></TD><TD>         * @see org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)</TD></TR><TR><TD CLASS="l">93</TD><TD>         */</TD></TR><TR><TD CLASS="l">94</TD><TD>        @Override</TD></TR><TR><TD CLASS="l">95</TD><TD>        public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {</TD></TR><TR CLASS="c"><TD CLASS="l">96</TD><TD>                if (fConfiguredContentTypes == null) {</TD></TR><TR CLASS="c"><TD CLASS="l">97</TD><TD>                        String[] xslTypes = StructuredTextPartitionerForXSL</TD></TR><TR CLASS="c"><TD CLASS="l">98</TD><TD>                                        .getConfiguredContentTypes();</TD></TR><TR CLASS="c"><TD CLASS="l">99</TD><TD>                        fConfiguredContentTypes = new String[xslTypes.length + 2];</TD></TR><TR CLASS="c"><TD CLASS="l">100</TD><TD>                        fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;</TD></TR><TR CLASS="c"><TD CLASS="l">101</TD><TD>                        fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;</TD></TR><TR CLASS="c"><TD CLASS="l">102</TD><TD>                        int index = 0;</TD></TR><TR CLASS="c"><TD CLASS="l">103</TD><TD>                        System.arraycopy(xslTypes, 0, fConfiguredContentTypes, index += 2,</TD></TR><TR CLASS="c"><TD CLASS="l">104</TD><TD>                                        xslTypes.length);</TD></TR><TR><TD CLASS="l">105</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">106</TD><TD>                return fConfiguredContentTypes;</TD></TR><TR><TD CLASS="l">107</TD><TD>        }</TD></TR><TR><TD CLASS="l"><A NAME="6">108</A></TD><TD> </TD></TR><TR><TD CLASS="l">109</TD><TD>        @Override</TD></TR><TR><TD CLASS="l">110</TD><TD>        public LineStyleProvider[] getLineStyleProviders(</TD></TR><TR><TD CLASS="l">111</TD><TD>                        ISourceViewer sourceViewer, String partitionType) {</TD></TR><TR CLASS="c"><TD CLASS="l">112</TD><TD>                LineStyleProvider[] providers = null;</TD></TR><TR CLASS="c"><TD CLASS="l">113</TD><TD>        if (isXMLPartition(partitionType)) {</TD></TR><TR CLASS="c"><TD CLASS="l">114</TD><TD>                    providers = new LineStyleProvider[] {getLineStyleProviderForXSL()};</TD></TR><TR><TD CLASS="l">115</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l"><A NAME="7">116</A></TD><TD>                return providers;</TD></TR><TR><TD CLASS="l">117</TD><TD>        }</TD></TR><TR><TD CLASS="l">118</TD><TD> </TD></TR><TR><TD CLASS="l">119</TD><TD>        private boolean isXMLPartition(String partitionType) {</TD></TR><TR CLASS="c"><TD CLASS="l">120</TD><TD>                return partitionType.equals(IXMLPartitions.XML_DEFAULT)</TD></TR><TR CLASS="c"><TD CLASS="l">121</TD><TD>                                || partitionType.equals(IXMLPartitions.XML_CDATA)</TD></TR><TR CLASS="c"><TD CLASS="l">122</TD><TD>                                || partitionType.equals(IXMLPartitions.XML_COMMENT)</TD></TR><TR CLASS="c"><TD CLASS="l">123</TD><TD>                                || partitionType.equals(IXMLPartitions.XML_DECLARATION)</TD></TR><TR CLASS="c"><TD CLASS="l">124</TD><TD>                                || partitionType.equals(IXMLPartitions.XML_PI)</TD></TR><TR CLASS="c"><TD CLASS="l"><A NAME="5">125</A></TD><TD>                                || partitionType.equals(IXSLPartitions.XSL_XPATH);</TD></TR><TR><TD CLASS="l">126</TD><TD>        }</TD></TR><TR><TD CLASS="l">127</TD><TD>        </TD></TR><TR><TD CLASS="l">128</TD><TD>        protected LineStyleProvider getLineStyleProviderForXSL() {</TD></TR><TR CLASS="c"><TD CLASS="l">129</TD><TD>                if (fLineStyleProviderForXSL == null) {</TD></TR><TR CLASS="c"><TD CLASS="l">130</TD><TD>                        fLineStyleProviderForXSL = new LineStyleProviderForXSL();</TD></TR><TR><TD CLASS="l">131</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">132</TD><TD>                return fLineStyleProviderForXSL;</TD></TR><TR><TD CLASS="l">133</TD><TD>        }</TD></TR><TR><TD CLASS="l">134</TD><TD>        </TD></TR><TR><TD CLASS="l">135</TD><TD>}</TD></TR></TABLE><P></P><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="8e.html">org.eclipse.wst.xsl.ui.internal</A>]</TD></TR><TR><TD CLASS="tl"><A HREF="http://www.eclemma.org/support.html">EMMA 2.0.5312 EclEmma Fix 1</A> (C) Vladimir Roubtsov</TD></TR></TABLE></BODY></HTML>