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

COVERAGE SUMMARY FOR SOURCE FILE [CostAnalysisTab.java]

nameclass, %method, %block, %line, %
CostAnalysisTab.java0%   (0/2)0%   (0/15)0%   (0/120)0%   (0/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CostAnalysisTab0%   (0/1)0%   (0/13)0%   (0/106)0%   (0/30)
CostAnalysisTab (): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$0 (CostAnalysisTab, boolean): void 0%   (0/1)0%   (0/4)0%   (0/1)
access$1 (CostAnalysisTab): void 0%   (0/1)0%   (0/3)0%   (0/1)
activated (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
createControl (Composite): void 0%   (0/1)0%   (0/37)0%   (0/7)
deactivated (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
dispose (): void 0%   (0/1)0%   (0/3)0%   (0/2)
getImage (): Image 0%   (0/1)0%   (0/2)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
initializeFrom (ILaunchConfiguration): void 0%   (0/1)0%   (0/16)0%   (0/5)
isValid (ILaunchConfiguration): boolean 0%   (0/1)0%   (0/26)0%   (0/5)
performApply (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/7)0%   (0/4)
setDefaults (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class CostAnalysisTab$10%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
CostAnalysisTab$1 (CostAnalysisTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
modifyText (ModifyEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)

1package de.uka.ipd.sdq.dsexplore.analysis.cost;
2 
3import org.eclipse.core.runtime.CoreException;
4import org.eclipse.debug.core.ILaunchConfiguration;
5import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6import org.eclipse.debug.ui.ILaunchConfigurationTab;
7import org.eclipse.swt.SWT;
8import org.eclipse.swt.events.ModifyEvent;
9import org.eclipse.swt.events.ModifyListener;
10import org.eclipse.swt.graphics.Image;
11import org.eclipse.swt.layout.GridLayout;
12import org.eclipse.swt.widgets.Composite;
13import org.eclipse.swt.widgets.Text;
14 
15import de.uka.ipd.sdq.dsexplore.launch.DSEConstantsContainer;
16import de.uka.ipd.sdq.workflow.launchconfig.RunConfigPlugin;
17import de.uka.ipd.sdq.workflow.launchconfig.tabs.TabHelper;
18import de.uka.ipd.sdq.workflow.pcm.runconfig.FileNamesInputTab;
19 
20public class CostAnalysisTab extends de.uka.ipd.sdq.workflow.pcm.runconfig.FileNamesInputTab implements
21                ILaunchConfigurationTab {
22 
23        private Text textCostModel;
24 
25        @Override
26        public void createControl(Composite parent) {
27                
28                // Create a listener for GUI modification events:
29                final ModifyListener modifyListener = new ModifyListener() {
30 
31                        public void modifyText(ModifyEvent e) {
32                                CostAnalysisTab.this.setDirty(true);
33                                CostAnalysisTab.this.updateLaunchConfigurationDialog();
34                        }
35                };
36                
37                // Create a new Composite to hold the page's controls:
38                final Composite container = new Composite(parent, SWT.NONE);
39                setControl(container);
40                container.setLayout(new GridLayout());
41 
42                /**
43                 * Add cost model input section
44                 */
45                this.textCostModel = new Text(container, SWT.SINGLE | SWT.BORDER);
46                TabHelper.createFileInputSection(container, modifyListener, "Cost Model File", DSEConstantsContainer.COST_MODEL_EXTENSION, textCostModel, getShell(), DSEConstantsContainer.DEFAULT_COST_MODEL_FILE);
47        }
48 
49        @Override
50        public String getName() {
51                return "Cost Analysis";
52        }
53 
54        @Override
55        public void initializeFrom(ILaunchConfiguration configuration) {
56                try {
57                        this.textCostModel.setText(configuration.getAttribute(
58                                        DSEConstantsContainer.COST_FILE, ""));
59                } catch (CoreException e) {
60                        RunConfigPlugin.errorLogger(getName(),DSEConstantsContainer.COST_FILE, e.getMessage());
61                }
62                
63        }
64 
65        @Override
66        public void performApply(ILaunchConfigurationWorkingCopy configuration) {
67                configuration.setAttribute(
68                                DSEConstantsContainer.COST_FILE, 
69                                this.textCostModel.getText());
70                
71        }
72 
73        @Override
74        public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
75                                
76        }
77 
78        @Override
79        public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
80                // Leave this method empty to prevent unnecessary invocation of
81                // initializeFrom() and multiple resulting invocations of
82                // performApply().
83                
84        }
85 
86        @Override
87        public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
88                                
89        }
90 
91        @Override
92        public void dispose() {
93                super.dispose();                
94        }
95 
96        @Override
97        public Image getImage() {
98                return null;
99        }
100 
101        @Override
102        public boolean isValid(ILaunchConfiguration launchConfig) {
103                String extension = DSEConstantsContainer.COST_MODEL_EXTENSION[0].replace("*", "");
104                if (this.textCostModel.getText().equals("") || !this.textCostModel.getText().contains(extension)){
105                        setErrorMessage("Cost model is missing!");
106                        return false;
107                }
108                return true;
109        }
110 
111 
112 
113}

[all classes][de.uka.ipd.sdq.dsexplore.analysis.cost]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov