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

COVERAGE SUMMARY FOR SOURCE FILE [DSEFileNamesInputTab.java]

nameclass, %method, %block, %line, %
DSEFileNamesInputTab.java0%   (0/2)0%   (0/10)0%   (0/151)0%   (0/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DSEFileNamesInputTab0%   (0/1)0%   (0/8)0%   (0/137)0%   (0/37)
DSEFileNamesInputTab (QMLManager): void 0%   (0/1)0%   (0/6)0%   (0/3)
access$0 (DSEFileNamesInputTab, boolean): void 0%   (0/1)0%   (0/4)0%   (0/1)
access$1 (DSEFileNamesInputTab): void 0%   (0/1)0%   (0/3)0%   (0/1)
createControl (Composite): void 0%   (0/1)0%   (0/35)0%   (0/7)
initializeFrom (ILaunchConfiguration): void 0%   (0/1)0%   (0/23)0%   (0/7)
isValid (ILaunchConfiguration): boolean 0%   (0/1)0%   (0/44)0%   (0/11)
loadQML (): void 0%   (0/1)0%   (0/10)0%   (0/2)
performApply (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/12)0%   (0/6)
     
class DSEFileNamesInputTab$10%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
DSEFileNamesInputTab$1 (DSEFileNamesInputTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
modifyText (ModifyEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.dsexplore.launch;
5 
6import org.eclipse.core.runtime.CoreException;
7import org.eclipse.debug.core.ILaunchConfiguration;
8import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
9import org.eclipse.swt.SWT;
10import org.eclipse.swt.events.ModifyEvent;
11import org.eclipse.swt.events.ModifyListener;
12import org.eclipse.swt.widgets.Composite;
13import org.eclipse.swt.widgets.Text;
14 
15import de.uka.ipd.sdq.workflow.launchconfig.RunConfigPlugin;
16import de.uka.ipd.sdq.workflow.launchconfig.tabs.TabHelper;
17import de.uka.ipd.sdq.workflow.pcm.runconfig.FileNamesInputTab;
18 
19/**
20 * The DSEFileNamesInputTab has additional QML logic.
21 * 
22 * @author noorshams
23 *
24 */
25public class DSEFileNamesInputTab extends FileNamesInputTab {
26        
27        protected Text textQMLDefinitionFile;
28        
29        protected QMLManager qmlManager;
30        
31        public DSEFileNamesInputTab(QMLManager qmlManager) {
32                super();
33                this.qmlManager = qmlManager;
34        }
35        
36        @Override
37        public void createControl(Composite parent) {
38                super.createControl(parent);
39                
40                final ModifyListener modifyListener = new ModifyListener() {
41 
42                        public void modifyText(ModifyEvent e) {
43                                DSEFileNamesInputTab.this.setDirty(true);
44                                DSEFileNamesInputTab.this.updateLaunchConfigurationDialog();
45                        }
46                };
47                
48                                
49                /**
50                 * Add QML input section
51                 */
52                this.textQMLDefinitionFile = new Text(container, SWT.SINGLE | SWT.BORDER);
53                String[] qmlExtension = new String[1];
54                qmlExtension[0] = DSEConstantsContainer.QML_DEFINITION_EXTENSION;
55                TabHelper.createFileInputSection(container, modifyListener, "QML Criteria Definitions", qmlExtension, textQMLDefinitionFile, getShell(), DSEConstantsContainer.DEFAULT_QML_CRITERIA_DEFINITIONS_FILE);
56        }
57        
58        protected void loadQML() {
59                qmlManager.processQMLFile(textQMLDefinitionFile.getText(), textUsage.getText());
60        }
61        
62        @Override
63        public void initializeFrom(ILaunchConfiguration configuration) {                
64                super.initializeFrom(configuration);
65                
66                try {
67                        String currentQMLPath = configuration.getAttribute(DSEConstantsContainer.QML_DEFINITION_FILE, "");
68                        this.textQMLDefinitionFile.setText(currentQMLPath);
69                } catch (CoreException e) {
70                        RunConfigPlugin.errorLogger(getName(),DSEConstantsContainer.QML_DEFINITION_FILE, e.getMessage());
71                }
72                
73                loadQML();
74        }
75        
76        @Override
77        public void performApply(ILaunchConfigurationWorkingCopy configuration) {                
78                super.performApply(configuration);
79                
80                configuration.setAttribute(
81                                DSEConstantsContainer.QML_DEFINITION_FILE, 
82                                this.textQMLDefinitionFile.getText());
83                
84                loadQML();
85        }
86        
87        @Override
88        public boolean isValid(ILaunchConfiguration launchConfig) {
89                setErrorMessage(null);
90                
91                if(!qmlManager.isQMLLoaded()){
92                        String errorMessage = "Select Usage Model and load QML Definition! For help, click the help button (?) in the bottom-left corner.";
93                        if(qmlManager.getDiagnosis() != null) {
94                                errorMessage += " "+qmlManager.getDiagnosis();
95                        }
96                        setErrorMessage(errorMessage);
97                        return false;
98                } else if(!qmlManager.hasActivatedObjectives()) {
99                        setErrorMessage("No objectives for specified UsageModel found in QML Definition. Make sure the right UsageModel is referenced and objectives are defined.");
100                        return false;
101                }
102                return super.isValid(launchConfig);
103        }
104}

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