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

COVERAGE SUMMARY FOR SOURCE FILE [StoExTemplateCompletionProcessor.java]

nameclass, %method, %block, %line, %
StoExTemplateCompletionProcessor.java0%   (0/1)0%   (0/4)0%   (0/76)0%   (0/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StoExTemplateCompletionProcessor0%   (0/1)0%   (0/4)0%   (0/76)0%   (0/21)
StoExTemplateCompletionProcessor (): void 0%   (0/1)0%   (0/3)0%   (0/2)
getContextType (ITextViewer, IRegion): TemplateContextType 0%   (0/1)0%   (0/5)0%   (0/1)
getImage (Template): Image 0%   (0/1)0%   (0/2)0%   (0/1)
getTemplates (String): Template [] 0%   (0/1)0%   (0/66)0%   (0/17)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcm.dialogs.stoex;
5 
6import java.util.ArrayList;
7import java.util.List;
8 
9import org.eclipse.jface.text.IRegion;
10import org.eclipse.jface.text.ITextViewer;
11import org.eclipse.jface.text.templates.Template;
12import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
13import org.eclipse.jface.text.templates.TemplateContextType;
14import org.eclipse.swt.graphics.Image;
15 
16/**
17 * @author Steffen Becker
18 *
19 */
20public class StoExTemplateCompletionProcessor extends
21                TemplateCompletionProcessor {
22 
23        public static final String STO_EX_CONTEXT_TYPE = "StoExContextType";
24 
25        /**
26         * 
27         */
28        public StoExTemplateCompletionProcessor() {
29                // TODO Auto-generated constructor stub
30        }
31 
32        /* (non-Javadoc)
33         * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getContextType(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
34         */
35        @Override
36        protected TemplateContextType getContextType(ITextViewer viewer,
37                        IRegion region) {
38                return new TemplateContextType(STO_EX_CONTEXT_TYPE);
39        }
40 
41        /* (non-Javadoc)
42         * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getImage(org.eclipse.jface.text.templates.Template)
43         */
44        @Override
45        protected Image getImage(Template template) {
46                return null;
47        }
48 
49        /* (non-Javadoc)
50         * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getTemplates(java.lang.String)
51         */
52        @Override
53        protected Template[] getTemplates(String contextTypeId) {
54                List<Template> templates = new ArrayList<Template>();
55 
56// Template with units:
57//                templates.add(new Template("DoublePDF",
58//                                "Creates a double random variable (BoxedPDF)", STO_EX_CONTEXT_TYPE,
59//                                "DoublePDF(unit=\"${unit}\")[(${x};${p})(${y};${q})(${z};${r})]", false));
60//                templates.add(new Template("IntPMF",
61//                                "Creates an integer random variable", STO_EX_CONTEXT_TYPE,
62//                                "IntPMF(unit=\"${unit}\")[(${x};${p})(${y};${q})(${z};${r})]", false));
63//                templates.add(new Template("DoublePMF",
64//                                "Creates a double random variable", STO_EX_CONTEXT_TYPE,
65//                                "DoublePMF(unit=\"${unit}\")[(${x};${p})(${y};${q})(${z};${r})]", false));
66//                templates.add(new Template("BoolPMF",
67//                                "Creates a boolean random variable", STO_EX_CONTEXT_TYPE,
68//                                "BoolPMF(unit=\"bool\")[(true;${p})(false;${q})]", false));
69//                templates.add(new Template("EnumPMF",
70//                                "Creates a enum random variable", STO_EX_CONTEXT_TYPE,
71//                                "EnumPMF(unit=\"${unit}\")[(${x};${p})]", false));
72 
73                templates.add(new Template("DoublePDF",
74                                "Creates a double random variable (BoxedPDF)", STO_EX_CONTEXT_TYPE,
75                                "DoublePDF[(${x};${p})(${y};${q})(${z};${r})]", false));
76                templates.add(new Template("IntPMF",
77                                "Creates an integer random variable", STO_EX_CONTEXT_TYPE,
78                                "IntPMF[(${x};${p})(${y};${q})(${z};${r})]", false));
79                templates.add(new Template("DoublePMF",
80                                "Creates a double random variable", STO_EX_CONTEXT_TYPE,
81                                "DoublePMF[(${x};${p})(${y};${q})(${z};${r})]", false));
82                templates.add(new Template("BoolPMF",
83                                "Creates a boolean random variable", STO_EX_CONTEXT_TYPE,
84                                "BoolPMF[(true;${p})(false;${q})]", false));
85                templates.add(new Template("EnumPMF",
86                                "Creates a enum random variable", STO_EX_CONTEXT_TYPE,
87                                "EnumPMF[(${x};${p})]", false));
88                
89                return templates.toArray(new Template[templates.size()]);
90        }
91}

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