diff options
Diffstat (limited to 'tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/47b.html')
-rw-r--r-- | tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/47b.html | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/47b.html b/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/47b.html deleted file mode 100644 index 3235c8e8..00000000 --- a/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/47b.html +++ /dev/null @@ -1 +0,0 @@ -<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 Tue Jun 09 19:59:05 GMT 2009)</TH></TR><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="4c.html">org.eclipse.jst.jsp.ui.internal.wizard</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">NewTagTemplatesWizardPage.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>NewTagTemplatesWizardPage.java</TD><TD CLASS="h">0% (0/9)</TD><TD CLASS="h">0% (0/35)</TD><TD CLASS="h">0% (0/816)</TD><TD CLASS="h">0% (0/190)</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">NewTagTemplatesWizardPage</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/14)</TD><TD CLASS="h">0% (0/583)</TD><TD CLASS="h">0% (0/143)</TD></TR><TR><TD CLASS="f"><A HREF="#0">NewTagTemplatesWizardPage (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/9)</TD><TD CLASS="h">0% (0/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2">configureTableResizing (Composite, Table, TableColumn, TableColumn): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/11)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="f"><A HREF="#3">createControl (Composite): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/260)</TD><TD CLASS="h">0% (0/54)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#4">createViewer (Composite): SourceViewer</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/35)</TD><TD CLASS="h">0% (0/8)</TD></TR><TR><TD CLASS="f"><A HREF="#5">doCreateViewer (Composite): SourceViewer</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/52)</TD><TD CLASS="h">0% (0/14)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#6">enableTemplates (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/39)</TD><TD CLASS="h">0% (0/11)</TD></TR><TR><TD CLASS="f"><A HREF="#7">getPreferencePageId (): String</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#8">getSelectedTemplate (): Template</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/17)</TD><TD CLASS="h">0% (0/5)</TD></TR><TR><TD CLASS="f"><A HREF="#9">getTemplateString (): String</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/39)</TD><TD CLASS="h">0% (0/11)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#a">linkClicked (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/22)</TD><TD CLASS="h">0% (0/5)</TD></TR><TR><TD CLASS="f"><A HREF="#b">loadLastSavedPreferences (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/28)</TD><TD CLASS="h">0% (0/8)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#c">saveLastSavedPreferences (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/18)</TD><TD CLASS="h">0% (0/7)</TD></TR><TR><TD CLASS="f"><A HREF="#d">setSelectedTemplate (String): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/33)</TD><TD CLASS="h">0% (0/9)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#e">updateViewerInput (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/18)</TD><TD CLASS="h">0% (0/5)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#2">NewTagTemplatesWizardPage$1</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/98)</TD><TD CLASS="h">0% (0/17)</TD></TR><TR><TD CLASS="f"><A HREF="#2">NewTagTemplatesWizardPage$1 (NewTagTemplatesWizardPage, Composite, Table, Tab...</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/18)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#11">controlResized (ControlEvent): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/80)</TD><TD CLASS="h">0% (0/15)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#12">NewTagTemplatesWizardPage$2</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/10)</TD><TD CLASS="h">0% (0/4)</TD></TR><TR><TD CLASS="f"><A HREF="#12">NewTagTemplatesWizardPage$2 (NewTagTemplatesWizardPage): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#14">widgetSelected (SelectionEvent): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/4)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#15">NewTagTemplatesWizardPage$3</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/42)</TD><TD CLASS="h">0% (0/11)</TD></TR><TR><TD CLASS="f"><A HREF="#15">NewTagTemplatesWizardPage$3 (NewTagTemplatesWizardPage): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#17">compare (Viewer, Object, Object): int</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/34)</TD><TD CLASS="h">0% (0/8)</TD></TR><TR><TD CLASS="f"><A HREF="#18">isSorterProperty (Object, String): boolean</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#19">NewTagTemplatesWizardPage$4</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/10)</TD><TD CLASS="h">0% (0/4)</TD></TR><TR><TD CLASS="f"><A HREF="#19">NewTagTemplatesWizardPage$4 (NewTagTemplatesWizardPage): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#1b">selectionChanged (SelectionChangedEvent): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/4)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#1c">NewTagTemplatesWizardPage$5</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/10)</TD><TD CLASS="h">0% (0/4)</TD></TR><TR><TD CLASS="f"><A HREF="#1c">NewTagTemplatesWizardPage$5 (NewTagTemplatesWizardPage): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#1e">widgetSelected (SelectionEvent): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/4)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#4">NewTagTemplatesWizardPage$6</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/22)</TD><TD CLASS="h">0% (0/5)</TD></TR><TR><TD CLASS="f"><A HREF="#4">NewTagTemplatesWizardPage$6 (NewTagTemplatesWizardPage): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/11)</TD><TD CLASS="h">0% (0/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#21">getConfiguredContentTypes (ISourceViewer): String []</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/5)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR><TD CLASS="f"><A HREF="#22">getLineStyleProviders (ISourceViewer, String): LineStyleProvider []</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#23">NewTagTemplatesWizardPage$TemplateContentProvider</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/4)</TD><TD CLASS="h">0% (0/20)</TD><TD CLASS="h">0% (0/6)</TD></TR><TR><TD CLASS="f"><A HREF="#23">NewTagTemplatesWizardPage$TemplateContentProvider (NewTagTemplatesWizardPage)...</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#25">dispose (): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/4)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="f"><A HREF="#26">getElements (Object): Object []</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/5)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#27">inputChanged (Viewer, Object, Object): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/5)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD><TD CLASS="bt"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#28">NewTagTemplatesWizardPage$TemplateLabelProvider</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/21)</TD><TD CLASS="h">0% (0/7)</TD></TR><TR><TD CLASS="f"><A HREF="#28">NewTagTemplatesWizardPage$TemplateLabelProvider (NewTagTemplatesWizardPage): ...</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/6)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2a">getColumnImage (Object, int): Image</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/2)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR><TD CLASS="f"><A HREF="#2b">getColumnText (Object, int): String</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/13)</TD><TD CLASS="h">0% (0/5)</TD></TR></TABLE><P></P><TABLE CLASS="s" CELLSPACING="0" WIDTH="100%"><TR CLASS="z"><TD CLASS="l">1</TD><TD>/*******************************************************************************</TD></TR><TR><TD CLASS="l">2</TD><TD> * Copyright (c) 2005, 2009 IBM Corporation 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> * IBM Corporation - initial API and implementation</TD></TR><TR><TD CLASS="l">10</TD><TD> *******************************************************************************/</TD></TR><TR><TD CLASS="l">11</TD><TD>package org.eclipse.jst.jsp.ui.internal.wizard;</TD></TR><TR><TD CLASS="l">12</TD><TD> </TD></TR><TR><TD CLASS="l">13</TD><TD>import org.eclipse.jface.dialogs.Dialog;</TD></TR><TR><TD CLASS="l">14</TD><TD>import org.eclipse.jface.preference.PreferenceDialog;</TD></TR><TR><TD CLASS="l">15</TD><TD>import org.eclipse.jface.resource.JFaceResources;</TD></TR><TR><TD CLASS="l">16</TD><TD>import org.eclipse.jface.text.Document;</TD></TR><TR><TD CLASS="l">17</TD><TD>import org.eclipse.jface.text.IDocument;</TD></TR><TR><TD CLASS="l">18</TD><TD>import org.eclipse.jface.text.source.ISourceViewer;</TD></TR><TR><TD CLASS="l">19</TD><TD>import org.eclipse.jface.text.source.SourceViewer;</TD></TR><TR><TD CLASS="l">20</TD><TD>import org.eclipse.jface.text.source.SourceViewerConfiguration;</TD></TR><TR><TD CLASS="l">21</TD><TD>import org.eclipse.jface.text.templates.DocumentTemplateContext;</TD></TR><TR><TD CLASS="l">22</TD><TD>import org.eclipse.jface.text.templates.Template;</TD></TR><TR><TD CLASS="l">23</TD><TD>import org.eclipse.jface.text.templates.TemplateBuffer;</TD></TR><TR><TD CLASS="l">24</TD><TD>import org.eclipse.jface.text.templates.TemplateContext;</TD></TR><TR><TD CLASS="l">25</TD><TD>import org.eclipse.jface.text.templates.TemplateContextType;</TD></TR><TR><TD CLASS="l">26</TD><TD>import org.eclipse.jface.text.templates.persistence.TemplateStore;</TD></TR><TR><TD CLASS="l">27</TD><TD>import org.eclipse.jface.viewers.ISelectionChangedListener;</TD></TR><TR><TD CLASS="l">28</TD><TD>import org.eclipse.jface.viewers.IStructuredContentProvider;</TD></TR><TR><TD CLASS="l">29</TD><TD>import org.eclipse.jface.viewers.IStructuredSelection;</TD></TR><TR><TD CLASS="l">30</TD><TD>import org.eclipse.jface.viewers.ITableLabelProvider;</TD></TR><TR><TD CLASS="l">31</TD><TD>import org.eclipse.jface.viewers.LabelProvider;</TD></TR><TR><TD CLASS="l">32</TD><TD>import org.eclipse.jface.viewers.SelectionChangedEvent;</TD></TR><TR><TD CLASS="l">33</TD><TD>import org.eclipse.jface.viewers.StructuredSelection;</TD></TR><TR><TD CLASS="l">34</TD><TD>import org.eclipse.jface.viewers.TableLayout;</TD></TR><TR><TD CLASS="l">35</TD><TD>import org.eclipse.jface.viewers.TableViewer;</TD></TR><TR><TD CLASS="l">36</TD><TD>import org.eclipse.jface.viewers.Viewer;</TD></TR><TR><TD CLASS="l">37</TD><TD>import org.eclipse.jface.viewers.ViewerSorter;</TD></TR><TR><TD CLASS="l">38</TD><TD>import org.eclipse.jface.wizard.WizardPage;</TD></TR><TR><TD CLASS="l">39</TD><TD>import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;</TD></TR><TR><TD CLASS="l">40</TD><TD>import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;</TD></TR><TR><TD CLASS="l">41</TD><TD>import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;</TD></TR><TR><TD CLASS="l">42</TD><TD>import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;</TD></TR><TR><TD CLASS="l">43</TD><TD>import org.eclipse.jst.jsp.ui.internal.Logger;</TD></TR><TR><TD CLASS="l">44</TD><TD>import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;</TD></TR><TR><TD CLASS="l">45</TD><TD>import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;</TD></TR><TR><TD CLASS="l">46</TD><TD>import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;</TD></TR><TR><TD CLASS="l">47</TD><TD>import org.eclipse.swt.SWT;</TD></TR><TR><TD CLASS="l">48</TD><TD>import org.eclipse.swt.events.ControlAdapter;</TD></TR><TR><TD CLASS="l">49</TD><TD>import org.eclipse.swt.events.ControlEvent;</TD></TR><TR><TD CLASS="l">50</TD><TD>import org.eclipse.swt.events.SelectionAdapter;</TD></TR><TR><TD CLASS="l">51</TD><TD>import org.eclipse.swt.events.SelectionEvent;</TD></TR><TR><TD CLASS="l">52</TD><TD>import org.eclipse.swt.graphics.Image;</TD></TR><TR><TD CLASS="l">53</TD><TD>import org.eclipse.swt.graphics.Point;</TD></TR><TR><TD CLASS="l">54</TD><TD>import org.eclipse.swt.graphics.Rectangle;</TD></TR><TR><TD CLASS="l">55</TD><TD>import org.eclipse.swt.layout.GridData;</TD></TR><TR><TD CLASS="l">56</TD><TD>import org.eclipse.swt.layout.GridLayout;</TD></TR><TR><TD CLASS="l">57</TD><TD>import org.eclipse.swt.widgets.Button;</TD></TR><TR><TD CLASS="l">58</TD><TD>import org.eclipse.swt.widgets.Composite;</TD></TR><TR><TD CLASS="l">59</TD><TD>import org.eclipse.swt.widgets.Control;</TD></TR><TR><TD CLASS="l">60</TD><TD>import org.eclipse.swt.widgets.Label;</TD></TR><TR><TD CLASS="l">61</TD><TD>import org.eclipse.swt.widgets.Link;</TD></TR><TR><TD CLASS="l">62</TD><TD>import org.eclipse.swt.widgets.Table;</TD></TR><TR><TD CLASS="l">63</TD><TD>import org.eclipse.swt.widgets.TableColumn;</TD></TR><TR><TD CLASS="l">64</TD><TD>import org.eclipse.ui.PlatformUI;</TD></TR><TR><TD CLASS="l">65</TD><TD>import org.eclipse.ui.dialogs.PreferencesUtil;</TD></TR><TR><TD CLASS="l">66</TD><TD>import org.eclipse.wst.sse.core.StructuredModelManager;</TD></TR><TR><TD CLASS="l">67</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;</TD></TR><TR><TD CLASS="l">68</TD><TD>import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;</TD></TR><TR><TD CLASS="l">69</TD><TD>import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;</TD></TR><TR><TD CLASS="l">70</TD><TD>import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;</TD></TR><TR><TD CLASS="l">71</TD><TD> </TD></TR><TR><TD CLASS="l">72</TD><TD>/**</TD></TR><TR><TD CLASS="l">73</TD><TD> * Templates page in new file wizard. Allows users to select a new file</TD></TR><TR><TD CLASS="l">74</TD><TD> * template to be applied in new file.</TD></TR><TR><TD CLASS="l">75</TD><TD> * </TD></TR><TR><TD CLASS="l">76</TD><TD> */</TD></TR><TR><TD CLASS="l">77</TD><TD>public class NewTagTemplatesWizardPage extends WizardPage {</TD></TR><TR><TD CLASS="l"><A NAME="23">78</A></TD><TD> </TD></TR><TR><TD CLASS="l">79</TD><TD> /**</TD></TR><TR><TD CLASS="l">80</TD><TD> * Content provider for templates</TD></TR><TR><TD CLASS="l">81</TD><TD> */</TD></TR><TR CLASS="z"><TD CLASS="l">82</TD><TD> private class TemplateContentProvider implements IStructuredContentProvider {</TD></TR><TR><TD CLASS="l">83</TD><TD> /** The template store. */</TD></TR><TR><TD CLASS="l">84</TD><TD> private TemplateStore fStore;</TD></TR><TR><TD CLASS="l">85</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="25">86</A></TD><TD> /*</TD></TR><TR><TD CLASS="l">87</TD><TD> * @see IContentProvider#dispose()</TD></TR><TR><TD CLASS="l">88</TD><TD> */</TD></TR><TR><TD CLASS="l">89</TD><TD> public void dispose() {</TD></TR><TR CLASS="z"><TD CLASS="l">90</TD><TD> fStore = null;</TD></TR><TR CLASS="z"><TD CLASS="l">91</TD><TD> }</TD></TR><TR><TD CLASS="l">92</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="26">93</A></TD><TD> /*</TD></TR><TR><TD CLASS="l">94</TD><TD> * @see IStructuredContentProvider#getElements(Object)</TD></TR><TR><TD CLASS="l">95</TD><TD> */</TD></TR><TR><TD CLASS="l">96</TD><TD> public Object[] getElements(Object input) {</TD></TR><TR CLASS="z"><TD CLASS="l">97</TD><TD> return fStore.getTemplates(TemplateContextTypeIdsJSP.NEW_TAG);</TD></TR><TR><TD CLASS="l">98</TD><TD> }</TD></TR><TR><TD CLASS="l">99</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="27">100</A></TD><TD> /*</TD></TR><TR><TD CLASS="l">101</TD><TD> * @see IContentProvider#inputChanged(Viewer, Object, Object)</TD></TR><TR><TD CLASS="l">102</TD><TD> */</TD></TR><TR><TD CLASS="l">103</TD><TD> public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {</TD></TR><TR CLASS="z"><TD CLASS="l">104</TD><TD> fStore = (TemplateStore) newInput;</TD></TR><TR CLASS="z"><TD CLASS="l">105</TD><TD> }</TD></TR><TR><TD CLASS="l">106</TD><TD> }</TD></TR><TR><TD CLASS="l"><A NAME="28">107</A></TD><TD> </TD></TR><TR><TD CLASS="l">108</TD><TD> /**</TD></TR><TR><TD CLASS="l">109</TD><TD> * Label provider for templates.</TD></TR><TR><TD CLASS="l">110</TD><TD> */</TD></TR><TR CLASS="z"><TD CLASS="l">111</TD><TD> private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {</TD></TR><TR><TD CLASS="l">112</TD><TD> </TD></TR><TR><TD CLASS="l">113</TD><TD> /*</TD></TR><TR><TD CLASS="l"><A NAME="2a">114</A></TD><TD> * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,</TD></TR><TR><TD CLASS="l">115</TD><TD> * int)</TD></TR><TR><TD CLASS="l">116</TD><TD> */</TD></TR><TR><TD CLASS="l">117</TD><TD> public Image getColumnImage(Object element, int columnIndex) {</TD></TR><TR CLASS="z"><TD CLASS="l">118</TD><TD> return null;</TD></TR><TR><TD CLASS="l">119</TD><TD> }</TD></TR><TR><TD CLASS="l">120</TD><TD> </TD></TR><TR><TD CLASS="l">121</TD><TD> /*</TD></TR><TR><TD CLASS="l"><A NAME="2b">122</A></TD><TD> * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,</TD></TR><TR><TD CLASS="l">123</TD><TD> * int)</TD></TR><TR><TD CLASS="l">124</TD><TD> */</TD></TR><TR><TD CLASS="l">125</TD><TD> public String getColumnText(Object element, int columnIndex) {</TD></TR><TR CLASS="z"><TD CLASS="l">126</TD><TD> Template template = (Template) element;</TD></TR><TR><TD CLASS="l">127</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">128</TD><TD> switch (columnIndex) {</TD></TR><TR><TD CLASS="l">129</TD><TD> case 0 :</TD></TR><TR CLASS="z"><TD CLASS="l">130</TD><TD> return template.getName();</TD></TR><TR><TD CLASS="l">131</TD><TD> case 1 :</TD></TR><TR CLASS="z"><TD CLASS="l">132</TD><TD> return template.getDescription();</TD></TR><TR><TD CLASS="l">133</TD><TD> default :</TD></TR><TR CLASS="z"><TD CLASS="l">134</TD><TD> return ""; //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">135</TD><TD> }</TD></TR><TR><TD CLASS="l">136</TD><TD> }</TD></TR><TR><TD CLASS="l">137</TD><TD> }</TD></TR><TR><TD CLASS="l">138</TD><TD> </TD></TR><TR><TD CLASS="l">139</TD><TD> /** Last selected template name */</TD></TR><TR><TD CLASS="l">140</TD><TD> private String fLastSelectedTemplateName;</TD></TR><TR><TD CLASS="l">141</TD><TD> /** The viewer displays the pattern of selected template. */</TD></TR><TR><TD CLASS="l">142</TD><TD> private SourceViewer fPatternViewer;</TD></TR><TR><TD CLASS="l">143</TD><TD> /** The table presenting the templates. */</TD></TR><TR><TD CLASS="l">144</TD><TD> private TableViewer fTableViewer;</TD></TR><TR><TD CLASS="l">145</TD><TD> /** Template store used by this wizard page */</TD></TR><TR><TD CLASS="l">146</TD><TD> private TemplateStore fTemplateStore;</TD></TR><TR><TD CLASS="l"><A NAME="0">147</A></TD><TD> /** Checkbox for using templates. */</TD></TR><TR><TD CLASS="l">148</TD><TD> private Button fUseTemplateButton;</TD></TR><TR><TD CLASS="l">149</TD><TD> </TD></TR><TR><TD CLASS="l">150</TD><TD> public NewTagTemplatesWizardPage() {</TD></TR><TR CLASS="z"><TD CLASS="l">151</TD><TD> super("NewJSPTemplatesWizardPage", JSPUIMessages.NewTagTemplatesWizardPage_0, null); //$NON-NLS-1$</TD></TR><TR CLASS="z"><TD CLASS="l">152</TD><TD> setDescription(JSPUIMessages.NewTagTemplatesWizardPage_1);</TD></TR><TR CLASS="z"><TD CLASS="l">153</TD><TD> }</TD></TR><TR><TD CLASS="l">154</TD><TD> </TD></TR><TR><TD CLASS="l">155</TD><TD> /**</TD></TR><TR><TD CLASS="l">156</TD><TD> * Correctly resizes the table so no phantom columns appear</TD></TR><TR><TD CLASS="l">157</TD><TD> * </TD></TR><TR><TD CLASS="l">158</TD><TD> * @param parent</TD></TR><TR><TD CLASS="l">159</TD><TD> * the parent control</TD></TR><TR><TD CLASS="l">160</TD><TD> * @param buttons</TD></TR><TR><TD CLASS="l">161</TD><TD> * the buttons</TD></TR><TR><TD CLASS="l">162</TD><TD> * @param table</TD></TR><TR><TD CLASS="l">163</TD><TD> * the table</TD></TR><TR><TD CLASS="l">164</TD><TD> * @param column1</TD></TR><TR><TD CLASS="l">165</TD><TD> * the first column</TD></TR><TR><TD CLASS="l">166</TD><TD> * @param column2</TD></TR><TR><TD CLASS="l">167</TD><TD> * the second column</TD></TR><TR><TD CLASS="l"><A NAME="2">168</A></TD><TD> * @param column3</TD></TR><TR><TD CLASS="l">169</TD><TD> * the third column</TD></TR><TR><TD CLASS="l"><A NAME="11">170</A></TD><TD> */</TD></TR><TR><TD CLASS="l">171</TD><TD> private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {</TD></TR><TR CLASS="z"><TD CLASS="l">172</TD><TD> parent.addControlListener(new ControlAdapter() {</TD></TR><TR><TD CLASS="l">173</TD><TD> public void controlResized(ControlEvent e) {</TD></TR><TR CLASS="z"><TD CLASS="l">174</TD><TD> Rectangle area = parent.getClientArea();</TD></TR><TR CLASS="z"><TD CLASS="l">175</TD><TD> Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);</TD></TR><TR CLASS="z"><TD CLASS="l">176</TD><TD> int width = area.width - 2 * table.getBorderWidth();</TD></TR><TR CLASS="z"><TD CLASS="l">177</TD><TD> if (preferredSize.y > area.height) {</TD></TR><TR><TD CLASS="l">178</TD><TD> // Subtract the scrollbar width from the total column</TD></TR><TR><TD CLASS="l">179</TD><TD> // width</TD></TR><TR><TD CLASS="l">180</TD><TD> // if a vertical scrollbar will be required</TD></TR><TR CLASS="z"><TD CLASS="l">181</TD><TD> Point vBarSize = table.getVerticalBar().getSize();</TD></TR><TR CLASS="z"><TD CLASS="l">182</TD><TD> width -= vBarSize.x;</TD></TR><TR><TD CLASS="l">183</TD><TD> }</TD></TR><TR><TD CLASS="l">184</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">185</TD><TD> Point oldSize = table.getSize();</TD></TR><TR CLASS="z"><TD CLASS="l">186</TD><TD> if (oldSize.x > width) {</TD></TR><TR><TD CLASS="l">187</TD><TD> // table is getting smaller so make the columns</TD></TR><TR><TD CLASS="l">188</TD><TD> // smaller first and then resize the table to</TD></TR><TR><TD CLASS="l">189</TD><TD> // match the client area width</TD></TR><TR CLASS="z"><TD CLASS="l">190</TD><TD> column1.setWidth(width / 2);</TD></TR><TR CLASS="z"><TD CLASS="l">191</TD><TD> column2.setWidth(width / 2);</TD></TR><TR CLASS="z"><TD CLASS="l">192</TD><TD> table.setSize(width, area.height);</TD></TR><TR><TD CLASS="l">193</TD><TD> }</TD></TR><TR><TD CLASS="l">194</TD><TD> else {</TD></TR><TR><TD CLASS="l">195</TD><TD> // table is getting bigger so make the table</TD></TR><TR><TD CLASS="l">196</TD><TD> // bigger first and then make the columns wider</TD></TR><TR><TD CLASS="l">197</TD><TD> // to match the client area width</TD></TR><TR CLASS="z"><TD CLASS="l">198</TD><TD> table.setSize(width, area.height);</TD></TR><TR CLASS="z"><TD CLASS="l">199</TD><TD> column1.setWidth(width / 2);</TD></TR><TR CLASS="z"><TD CLASS="l">200</TD><TD> column2.setWidth(width / 2);</TD></TR><TR><TD CLASS="l">201</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">202</TD><TD> }</TD></TR><TR><TD CLASS="l"><A NAME="3">203</A></TD><TD> });</TD></TR><TR CLASS="z"><TD CLASS="l">204</TD><TD> }</TD></TR><TR><TD CLASS="l">205</TD><TD> </TD></TR><TR><TD CLASS="l">206</TD><TD> public void createControl(Composite ancestor) {</TD></TR><TR CLASS="z"><TD CLASS="l">207</TD><TD> Composite parent = new Composite(ancestor, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">208</TD><TD> GridLayout layout = new GridLayout();</TD></TR><TR CLASS="z"><TD CLASS="l">209</TD><TD> layout.numColumns = 2;</TD></TR><TR CLASS="z"><TD CLASS="l">210</TD><TD> parent.setLayout(layout);</TD></TR><TR><TD CLASS="l">211</TD><TD> </TD></TR><TR><TD CLASS="l">212</TD><TD> // create checkbox for user to use JSP Template</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="12">213</A></TD><TD> fUseTemplateButton = new Button(parent, SWT.CHECK);</TD></TR><TR CLASS="z"><TD CLASS="l">214</TD><TD> fUseTemplateButton.setText(JSPUIMessages.NewTagTemplatesWizardPage_4);</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="14">215</A></TD><TD> GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);</TD></TR><TR CLASS="z"><TD CLASS="l">216</TD><TD> fUseTemplateButton.setLayoutData(data);</TD></TR><TR CLASS="z"><TD CLASS="l">217</TD><TD> fUseTemplateButton.addSelectionListener(new SelectionAdapter() {</TD></TR><TR><TD CLASS="l">218</TD><TD> public void widgetSelected(SelectionEvent e) {</TD></TR><TR CLASS="z"><TD CLASS="l">219</TD><TD> enableTemplates();</TD></TR><TR CLASS="z"><TD CLASS="l">220</TD><TD> }</TD></TR><TR><TD CLASS="l">221</TD><TD> });</TD></TR><TR><TD CLASS="l">222</TD><TD> </TD></TR><TR><TD CLASS="l">223</TD><TD> // create composite for Templates table</TD></TR><TR CLASS="z"><TD CLASS="l">224</TD><TD> Composite innerParent = new Composite(parent, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">225</TD><TD> GridLayout innerLayout = new GridLayout();</TD></TR><TR CLASS="z"><TD CLASS="l">226</TD><TD> innerLayout.numColumns = 2;</TD></TR><TR CLASS="z"><TD CLASS="l">227</TD><TD> innerLayout.marginHeight = 0;</TD></TR><TR CLASS="z"><TD CLASS="l">228</TD><TD> innerLayout.marginWidth = 0;</TD></TR><TR CLASS="z"><TD CLASS="l">229</TD><TD> innerParent.setLayout(innerLayout);</TD></TR><TR CLASS="z"><TD CLASS="l">230</TD><TD> GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);</TD></TR><TR CLASS="z"><TD CLASS="l">231</TD><TD> innerParent.setLayoutData(gd);</TD></TR><TR><TD CLASS="l">232</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">233</TD><TD> Label label = new Label(innerParent, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">234</TD><TD> label.setText(JSPUIMessages.NewTagTemplatesWizardPage_7);</TD></TR><TR CLASS="z"><TD CLASS="l">235</TD><TD> data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);</TD></TR><TR CLASS="z"><TD CLASS="l">236</TD><TD> label.setLayoutData(data);</TD></TR><TR><TD CLASS="l">237</TD><TD> </TD></TR><TR><TD CLASS="l">238</TD><TD> // create table that displays templates</TD></TR><TR CLASS="z"><TD CLASS="l">239</TD><TD> Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);</TD></TR><TR><TD CLASS="l">240</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">241</TD><TD> data = new GridData(GridData.FILL_BOTH);</TD></TR><TR CLASS="z"><TD CLASS="l">242</TD><TD> data.widthHint = convertWidthInCharsToPixels(2);</TD></TR><TR CLASS="z"><TD CLASS="l">243</TD><TD> data.heightHint = convertHeightInCharsToPixels(10);</TD></TR><TR CLASS="z"><TD CLASS="l">244</TD><TD> data.horizontalSpan = 2;</TD></TR><TR CLASS="z"><TD CLASS="l">245</TD><TD> table.setLayoutData(data);</TD></TR><TR CLASS="z"><TD CLASS="l">246</TD><TD> table.setHeaderVisible(true);</TD></TR><TR CLASS="z"><TD CLASS="l">247</TD><TD> table.setLinesVisible(true);</TD></TR><TR CLASS="z"><TD CLASS="l">248</TD><TD> TableLayout tableLayout = new TableLayout();</TD></TR><TR CLASS="z"><TD CLASS="l">249</TD><TD> table.setLayout(tableLayout);</TD></TR><TR><TD CLASS="l">250</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">251</TD><TD> TableColumn column1 = new TableColumn(table, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">252</TD><TD> column1.setText(JSPUIMessages.NewTagTemplatesWizardPage_2);</TD></TR><TR><TD CLASS="l">253</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">254</TD><TD> TableColumn column2 = new TableColumn(table, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">255</TD><TD> column2.setText(JSPUIMessages.NewTagTemplatesWizardPage_3);</TD></TR><TR><TD CLASS="l">256</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="15">257</A></TD><TD> fTableViewer = new TableViewer(table);</TD></TR><TR CLASS="z"><TD CLASS="l">258</TD><TD> fTableViewer.setLabelProvider(new TemplateLabelProvider());</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="17">259</A></TD><TD> fTableViewer.setContentProvider(new TemplateContentProvider());</TD></TR><TR><TD CLASS="l">260</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">261</TD><TD> fTableViewer.setSorter(new ViewerSorter() {</TD></TR><TR><TD CLASS="l">262</TD><TD> public int compare(Viewer viewer, Object object1, Object object2) {</TD></TR><TR CLASS="z"><TD CLASS="l">263</TD><TD> if ((object1 instanceof Template) && (object2 instanceof Template)) {</TD></TR><TR CLASS="z"><TD CLASS="l">264</TD><TD> Template left = (Template) object1;</TD></TR><TR CLASS="z"><TD CLASS="l">265</TD><TD> Template right = (Template) object2;</TD></TR><TR CLASS="z"><TD CLASS="l">266</TD><TD> int result = left.getName().compareToIgnoreCase(right.getName());</TD></TR><TR CLASS="z"><TD CLASS="l">267</TD><TD> if (result != 0)</TD></TR><TR CLASS="z"><TD CLASS="l">268</TD><TD> return result;</TD></TR><TR CLASS="z"><TD CLASS="l">269</TD><TD> return left.getDescription().compareToIgnoreCase(right.getDescription());</TD></TR><TR><TD CLASS="l">270</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="18">271</A></TD><TD> return super.compare(viewer, object1, object2);</TD></TR><TR><TD CLASS="l">272</TD><TD> }</TD></TR><TR><TD CLASS="l">273</TD><TD> </TD></TR><TR><TD CLASS="l">274</TD><TD> public boolean isSorterProperty(Object element, String property) {</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="19">275</A></TD><TD> return true;</TD></TR><TR><TD CLASS="l">276</TD><TD> }</TD></TR><TR><TD CLASS="l"><A NAME="1b">277</A></TD><TD> });</TD></TR><TR><TD CLASS="l">278</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">279</TD><TD> fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {</TD></TR><TR><TD CLASS="l">280</TD><TD> public void selectionChanged(SelectionChangedEvent e) {</TD></TR><TR CLASS="z"><TD CLASS="l">281</TD><TD> updateViewerInput();</TD></TR><TR CLASS="z"><TD CLASS="l">282</TD><TD> }</TD></TR><TR><TD CLASS="l">283</TD><TD> });</TD></TR><TR><TD CLASS="l">284</TD><TD> </TD></TR><TR><TD CLASS="l">285</TD><TD> // create viewer that displays currently selected template's contents</TD></TR><TR CLASS="z"><TD CLASS="l">286</TD><TD> fPatternViewer = doCreateViewer(parent);</TD></TR><TR><TD CLASS="l">287</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">288</TD><TD> fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();</TD></TR><TR CLASS="z"><TD CLASS="l">289</TD><TD> fTableViewer.setInput(fTemplateStore);</TD></TR><TR><TD CLASS="l">290</TD><TD> </TD></TR><TR><TD CLASS="l">291</TD><TD> // Create linked text to just to templates preference page</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="1c">292</A></TD><TD> Link link = new Link(parent, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">293</TD><TD> link.setText(JSPUIMessages.NewTagTemplatesWizardPage_6);</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="1e">294</A></TD><TD> data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);</TD></TR><TR CLASS="z"><TD CLASS="l">295</TD><TD> link.setLayoutData(data);</TD></TR><TR CLASS="z"><TD CLASS="l">296</TD><TD> link.addSelectionListener(new SelectionAdapter() {</TD></TR><TR><TD CLASS="l">297</TD><TD> public void widgetSelected(SelectionEvent e) {</TD></TR><TR CLASS="z"><TD CLASS="l">298</TD><TD> linkClicked();</TD></TR><TR CLASS="z"><TD CLASS="l">299</TD><TD> }</TD></TR><TR><TD CLASS="l">300</TD><TD> });</TD></TR><TR><TD CLASS="l">301</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">302</TD><TD> configureTableResizing(innerParent, table, column1, column2);</TD></TR><TR CLASS="z"><TD CLASS="l">303</TD><TD> loadLastSavedPreferences();</TD></TR><TR><TD CLASS="l">304</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">305</TD><TD> PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.JSP_NEWWIZARD_TEMPLATE_HELPID);</TD></TR><TR CLASS="z"><TD CLASS="l">306</TD><TD> Dialog.applyDialogFont(parent);</TD></TR><TR CLASS="z"><TD CLASS="l">307</TD><TD> setControl(parent);</TD></TR><TR CLASS="z"><TD CLASS="l">308</TD><TD> }</TD></TR><TR><TD CLASS="l">309</TD><TD> </TD></TR><TR><TD CLASS="l">310</TD><TD> /**</TD></TR><TR><TD CLASS="l">311</TD><TD> * Creates, configures and returns a source viewer to present the template</TD></TR><TR><TD CLASS="l">312</TD><TD> * pattern on the preference page. Clients may override to provide a</TD></TR><TR><TD CLASS="l">313</TD><TD> * custom source viewer featuring e.g. syntax coloring.</TD></TR><TR><TD CLASS="l">314</TD><TD> * </TD></TR><TR><TD CLASS="l">315</TD><TD> * @param parent</TD></TR><TR><TD CLASS="l"><A NAME="4">316</A></TD><TD> * the parent control</TD></TR><TR><TD CLASS="l">317</TD><TD> * @return a configured source viewer</TD></TR><TR><TD CLASS="l">318</TD><TD> */</TD></TR><TR><TD CLASS="l">319</TD><TD> private SourceViewer createViewer(Composite parent) {</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="21">320</A></TD><TD> SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {</TD></TR><TR CLASS="z"><TD CLASS="l">321</TD><TD> StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();</TD></TR><TR><TD CLASS="l">322</TD><TD> </TD></TR><TR><TD CLASS="l">323</TD><TD> public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="22">324</A></TD><TD> return baseConfiguration.getConfiguredContentTypes(sourceViewer);</TD></TR><TR><TD CLASS="l">325</TD><TD> }</TD></TR><TR><TD CLASS="l">326</TD><TD> </TD></TR><TR><TD CLASS="l">327</TD><TD> public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {</TD></TR><TR CLASS="z"><TD CLASS="l">328</TD><TD> return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);</TD></TR><TR><TD CLASS="l">329</TD><TD> }</TD></TR><TR><TD CLASS="l">330</TD><TD> };</TD></TR><TR CLASS="z"><TD CLASS="l">331</TD><TD> SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);</TD></TR><TR CLASS="z"><TD CLASS="l">332</TD><TD> ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$</TD></TR><TR CLASS="z"><TD CLASS="l">333</TD><TD> IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSPTAG);</TD></TR><TR CLASS="z"><TD CLASS="l">334</TD><TD> IDocument document = scratchModel.getStructuredDocument();</TD></TR><TR CLASS="z"><TD CLASS="l">335</TD><TD> viewer.configure(sourceViewerConfiguration);</TD></TR><TR CLASS="z"><TD CLASS="l">336</TD><TD> viewer.setDocument(document);</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="5">337</A></TD><TD> return viewer;</TD></TR><TR><TD CLASS="l">338</TD><TD> }</TD></TR><TR><TD CLASS="l">339</TD><TD> </TD></TR><TR><TD CLASS="l">340</TD><TD> private SourceViewer doCreateViewer(Composite parent) {</TD></TR><TR CLASS="z"><TD CLASS="l">341</TD><TD> Label label = new Label(parent, SWT.NONE);</TD></TR><TR CLASS="z"><TD CLASS="l">342</TD><TD> label.setText(JSPUIMessages.NewTagTemplatesWizardPage_5);</TD></TR><TR CLASS="z"><TD CLASS="l">343</TD><TD> GridData data = new GridData();</TD></TR><TR CLASS="z"><TD CLASS="l">344</TD><TD> data.horizontalSpan = 2;</TD></TR><TR CLASS="z"><TD CLASS="l">345</TD><TD> label.setLayoutData(data);</TD></TR><TR><TD CLASS="l">346</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">347</TD><TD> SourceViewer viewer = createViewer(parent);</TD></TR><TR CLASS="z"><TD CLASS="l">348</TD><TD> viewer.setEditable(false);</TD></TR><TR><TD CLASS="l">349</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">350</TD><TD> Control control = viewer.getControl();</TD></TR><TR CLASS="z"><TD CLASS="l">351</TD><TD> data = new GridData(GridData.FILL_BOTH);</TD></TR><TR CLASS="z"><TD CLASS="l">352</TD><TD> data.horizontalSpan = 2;</TD></TR><TR CLASS="z"><TD CLASS="l">353</TD><TD> data.heightHint = convertHeightInCharsToPixels(5);</TD></TR><TR><TD CLASS="l">354</TD><TD> // [261274] - source viewer was growing to fit the max line width of the template</TD></TR><TR CLASS="z"><TD CLASS="l">355</TD><TD> data.widthHint = convertWidthInCharsToPixels(2);</TD></TR><TR CLASS="z"><TD CLASS="l">356</TD><TD> control.setLayoutData(data);</TD></TR><TR><TD CLASS="l">357</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">358</TD><TD> return viewer;</TD></TR><TR><TD CLASS="l">359</TD><TD> }</TD></TR><TR><TD CLASS="l">360</TD><TD> </TD></TR><TR><TD CLASS="l">361</TD><TD> /**</TD></TR><TR><TD CLASS="l"><A NAME="6">362</A></TD><TD> * Enable/disable controls in page based on fUseTemplateButton's current</TD></TR><TR><TD CLASS="l">363</TD><TD> * state.</TD></TR><TR><TD CLASS="l">364</TD><TD> */</TD></TR><TR><TD CLASS="l">365</TD><TD> void enableTemplates() {</TD></TR><TR CLASS="z"><TD CLASS="l">366</TD><TD> boolean enabled = fUseTemplateButton.getSelection();</TD></TR><TR><TD CLASS="l">367</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">368</TD><TD> if (!enabled) {</TD></TR><TR><TD CLASS="l">369</TD><TD> // save last selected template</TD></TR><TR CLASS="z"><TD CLASS="l">370</TD><TD> Template template = getSelectedTemplate();</TD></TR><TR CLASS="z"><TD CLASS="l">371</TD><TD> if (template != null)</TD></TR><TR CLASS="z"><TD CLASS="l">372</TD><TD> fLastSelectedTemplateName = template.getName();</TD></TR><TR><TD CLASS="l">373</TD><TD> else</TD></TR><TR CLASS="z"><TD CLASS="l">374</TD><TD> fLastSelectedTemplateName = ""; //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">375</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">376</TD><TD> fTableViewer.setSelection(null);</TD></TR><TR><TD CLASS="l">377</TD><TD> }</TD></TR><TR><TD CLASS="l">378</TD><TD> else {</TD></TR><TR CLASS="z"><TD CLASS="l">379</TD><TD> setSelectedTemplate(fLastSelectedTemplateName);</TD></TR><TR><TD CLASS="l">380</TD><TD> }</TD></TR><TR><TD CLASS="l">381</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">382</TD><TD> fTableViewer.getControl().setEnabled(enabled);</TD></TR><TR CLASS="z"><TD CLASS="l">383</TD><TD> fPatternViewer.getControl().setEnabled(enabled);</TD></TR><TR CLASS="z"><TD CLASS="l">384</TD><TD> }</TD></TR><TR><TD CLASS="l">385</TD><TD> </TD></TR><TR><TD CLASS="l">386</TD><TD> /**</TD></TR><TR><TD CLASS="l">387</TD><TD> * Return the template preference page id</TD></TR><TR><TD CLASS="l"><A NAME="7">388</A></TD><TD> * </TD></TR><TR><TD CLASS="l">389</TD><TD> * @return</TD></TR><TR><TD CLASS="l">390</TD><TD> */</TD></TR><TR><TD CLASS="l">391</TD><TD> private String getPreferencePageId() {</TD></TR><TR CLASS="z"><TD CLASS="l">392</TD><TD> return "org.eclipse.wst.sse.ui.preferences.jsp.templates"; //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">393</TD><TD> }</TD></TR><TR><TD CLASS="l">394</TD><TD> </TD></TR><TR><TD CLASS="l">395</TD><TD> /**</TD></TR><TR><TD CLASS="l">396</TD><TD> * Get the currently selected template.</TD></TR><TR><TD CLASS="l"><A NAME="8">397</A></TD><TD> * </TD></TR><TR><TD CLASS="l">398</TD><TD> * @return</TD></TR><TR><TD CLASS="l">399</TD><TD> */</TD></TR><TR><TD CLASS="l">400</TD><TD> private Template getSelectedTemplate() {</TD></TR><TR CLASS="z"><TD CLASS="l">401</TD><TD> Template template = null;</TD></TR><TR CLASS="z"><TD CLASS="l">402</TD><TD> IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();</TD></TR><TR><TD CLASS="l">403</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">404</TD><TD> if (selection.size() == 1) {</TD></TR><TR CLASS="z"><TD CLASS="l">405</TD><TD> template = (Template) selection.getFirstElement();</TD></TR><TR><TD CLASS="l">406</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">407</TD><TD> return template;</TD></TR><TR><TD CLASS="l">408</TD><TD> }</TD></TR><TR><TD CLASS="l">409</TD><TD> </TD></TR><TR><TD CLASS="l">410</TD><TD> /**</TD></TR><TR><TD CLASS="l">411</TD><TD> * Returns template string to insert.</TD></TR><TR><TD CLASS="l"><A NAME="9">412</A></TD><TD> * </TD></TR><TR><TD CLASS="l">413</TD><TD> * @return String to insert or null if none is to be inserted</TD></TR><TR><TD CLASS="l">414</TD><TD> */</TD></TR><TR><TD CLASS="l">415</TD><TD> String getTemplateString() {</TD></TR><TR CLASS="z"><TD CLASS="l">416</TD><TD> String templateString = null;</TD></TR><TR><TD CLASS="l">417</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">418</TD><TD> Template template = getSelectedTemplate();</TD></TR><TR CLASS="z"><TD CLASS="l">419</TD><TD> if (template != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">420</TD><TD> TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW);</TD></TR><TR CLASS="z"><TD CLASS="l">421</TD><TD> IDocument document = new Document();</TD></TR><TR CLASS="z"><TD CLASS="l">422</TD><TD> TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);</TD></TR><TR><TD CLASS="l">423</TD><TD> try {</TD></TR><TR CLASS="z"><TD CLASS="l">424</TD><TD> TemplateBuffer buffer = context.evaluate(template);</TD></TR><TR CLASS="z"><TD CLASS="l">425</TD><TD> templateString = buffer.getString();</TD></TR><TR><TD CLASS="l">426</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">427</TD><TD> catch (Exception e) {</TD></TR><TR CLASS="z"><TD CLASS="l">428</TD><TD> Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp", e); //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">429</TD><TD> }</TD></TR><TR><TD CLASS="l">430</TD><TD> }</TD></TR><TR><TD CLASS="l">431</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="a">432</A></TD><TD> return templateString;</TD></TR><TR><TD CLASS="l">433</TD><TD> }</TD></TR><TR><TD CLASS="l">434</TD><TD> </TD></TR><TR><TD CLASS="l">435</TD><TD> void linkClicked() {</TD></TR><TR CLASS="z"><TD CLASS="l">436</TD><TD> String pageId = getPreferencePageId();</TD></TR><TR CLASS="z"><TD CLASS="l">437</TD><TD> PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);</TD></TR><TR CLASS="z"><TD CLASS="l">438</TD><TD> dialog.open();</TD></TR><TR CLASS="z"><TD CLASS="l">439</TD><TD> fTableViewer.refresh();</TD></TR><TR CLASS="z"><TD CLASS="l">440</TD><TD> }</TD></TR><TR><TD CLASS="l">441</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="b">442</A></TD><TD> /**</TD></TR><TR><TD CLASS="l">443</TD><TD> * Load the last template name used in New JSP File wizard.</TD></TR><TR><TD CLASS="l">444</TD><TD> */</TD></TR><TR><TD CLASS="l">445</TD><TD> private void loadLastSavedPreferences() {</TD></TR><TR CLASS="z"><TD CLASS="l">446</TD><TD> String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);</TD></TR><TR CLASS="z"><TD CLASS="l">447</TD><TD> if (templateName == null || templateName.length() == 0) {</TD></TR><TR CLASS="z"><TD CLASS="l">448</TD><TD> fLastSelectedTemplateName = ""; //$NON-NLS-1$</TD></TR><TR CLASS="z"><TD CLASS="l">449</TD><TD> fUseTemplateButton.setSelection(false);</TD></TR><TR><TD CLASS="l">450</TD><TD> }</TD></TR><TR><TD CLASS="l">451</TD><TD> else {</TD></TR><TR CLASS="z"><TD CLASS="l">452</TD><TD> fLastSelectedTemplateName = templateName;</TD></TR><TR CLASS="z"><TD CLASS="l">453</TD><TD> fUseTemplateButton.setSelection(true);</TD></TR><TR><TD CLASS="l">454</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">455</TD><TD> enableTemplates();</TD></TR><TR CLASS="z"><TD CLASS="l">456</TD><TD> }</TD></TR><TR><TD CLASS="l">457</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="c">458</A></TD><TD> /**</TD></TR><TR><TD CLASS="l">459</TD><TD> * Save template name used for next call to New JSP File wizard.</TD></TR><TR><TD CLASS="l">460</TD><TD> */</TD></TR><TR><TD CLASS="l">461</TD><TD> void saveLastSavedPreferences() {</TD></TR><TR CLASS="z"><TD CLASS="l">462</TD><TD> String templateName = ""; //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">463</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">464</TD><TD> Template template = getSelectedTemplate();</TD></TR><TR CLASS="z"><TD CLASS="l">465</TD><TD> if (template != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">466</TD><TD> templateName = template.getName();</TD></TR><TR><TD CLASS="l">467</TD><TD> }</TD></TR><TR><TD CLASS="l">468</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">469</TD><TD> JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);</TD></TR><TR CLASS="z"><TD CLASS="l">470</TD><TD> JSPUIPlugin.getDefault().savePluginPreferences();</TD></TR><TR CLASS="z"><TD CLASS="l">471</TD><TD> }</TD></TR><TR><TD CLASS="l">472</TD><TD> </TD></TR><TR><TD CLASS="l">473</TD><TD> /**</TD></TR><TR><TD CLASS="l">474</TD><TD> * Select a template in the table viewer given the template name. If</TD></TR><TR><TD CLASS="l">475</TD><TD> * template name cannot be found or templateName is null, just select</TD></TR><TR><TD CLASS="l">476</TD><TD> * first item in table. If no items in table select nothing.</TD></TR><TR><TD CLASS="l"><A NAME="d">477</A></TD><TD> * </TD></TR><TR><TD CLASS="l">478</TD><TD> * @param templateName</TD></TR><TR><TD CLASS="l">479</TD><TD> */</TD></TR><TR><TD CLASS="l">480</TD><TD> private void setSelectedTemplate(String templateName) {</TD></TR><TR CLASS="z"><TD CLASS="l">481</TD><TD> Object template = null;</TD></TR><TR><TD CLASS="l">482</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">483</TD><TD> if (templateName != null && templateName.length() > 0) {</TD></TR><TR><TD CLASS="l">484</TD><TD> // pick the last used template</TD></TR><TR CLASS="z"><TD CLASS="l">485</TD><TD> template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW);</TD></TR><TR><TD CLASS="l">486</TD><TD> }</TD></TR><TR><TD CLASS="l">487</TD><TD> </TD></TR><TR><TD CLASS="l">488</TD><TD> // no record of last used template so just pick first element</TD></TR><TR CLASS="z"><TD CLASS="l">489</TD><TD> if (template == null) {</TD></TR><TR><TD CLASS="l">490</TD><TD> // just pick first element</TD></TR><TR CLASS="z"><TD CLASS="l">491</TD><TD> template = fTableViewer.getElementAt(0);</TD></TR><TR><TD CLASS="l">492</TD><TD> }</TD></TR><TR><TD CLASS="l">493</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">494</TD><TD> if (template != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">495</TD><TD> IStructuredSelection selection = new StructuredSelection(template);</TD></TR><TR CLASS="z"><TD CLASS="l">496</TD><TD> fTableViewer.setSelection(selection, true);</TD></TR><TR><TD CLASS="l">497</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">498</TD><TD> }</TD></TR><TR><TD CLASS="l">499</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="e">500</A></TD><TD> /**</TD></TR><TR><TD CLASS="l">501</TD><TD> * Updates the pattern viewer.</TD></TR><TR><TD CLASS="l">502</TD><TD> */</TD></TR><TR><TD CLASS="l">503</TD><TD> void updateViewerInput() {</TD></TR><TR CLASS="z"><TD CLASS="l">504</TD><TD> Template template = getSelectedTemplate();</TD></TR><TR CLASS="z"><TD CLASS="l">505</TD><TD> if (template != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">506</TD><TD> fPatternViewer.getDocument().set(template.getPattern());</TD></TR><TR><TD CLASS="l">507</TD><TD> }</TD></TR><TR><TD CLASS="l">508</TD><TD> else {</TD></TR><TR CLASS="z"><TD CLASS="l">509</TD><TD> fPatternViewer.getDocument().set(""); //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">510</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">511</TD><TD> }</TD></TR><TR><TD CLASS="l">512</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="4c.html">org.eclipse.jst.jsp.ui.internal.wizard</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>
\ No newline at end of file |