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

COVERAGE SUMMARY FOR SOURCE FILE [CipConfigTab.java]

nameclass, %method, %block, %line, %
CipConfigTab.java0%   (0/5)0%   (0/23)0%   (0/414)0%   (0/99)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CipConfigTab0%   (0/1)0%   (0/15)0%   (0/340)0%   (0/84)
CipConfigTab (): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$0 (CipConfigTab, boolean): void 0%   (0/1)0%   (0/4)0%   (0/1)
access$1 (CipConfigTab): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$2 (CipConfigTab, boolean): void 0%   (0/1)0%   (0/4)0%   (0/1)
access$3 (CipConfigTab): Text 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/236)0%   (0/48)
deactivated (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
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/36)0%   (0/12)
isValid (ILaunchConfiguration): boolean 0%   (0/1)0%   (0/16)0%   (0/5)
performApply (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/19)0%   (0/7)
setDefaults (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
setElementsEnabled (boolean): void 0%   (0/1)0%   (0/9)0%   (0/3)
     
class CipConfigTab$10%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
CipConfigTab$1 (CipConfigTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
modifyText (ModifyEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)
     
class CipConfigTab$20%   (0/1)0%   (0/2)0%   (0/32)0%   (0/8)
CipConfigTab$2 (CipConfigTab, Button): void 0%   (0/1)0%   (0/9)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/23)0%   (0/6)
     
class CipConfigTab$30%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
CipConfigTab$3 (CipConfigTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)
     
class CipConfigTab$40%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
CipConfigTab$4 (CipConfigTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)

1package de.uka.ipd.sdq.cip.runtime.runconfig.tabs;
2 
3import org.eclipse.core.runtime.CoreException;
4import org.eclipse.debug.core.ILaunchConfiguration;
5import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6import org.eclipse.swt.SWT;
7import org.eclipse.swt.events.ModifyEvent;
8import org.eclipse.swt.events.ModifyListener;
9import org.eclipse.swt.events.SelectionAdapter;
10import org.eclipse.swt.events.SelectionEvent;
11import org.eclipse.swt.graphics.Image;
12import org.eclipse.swt.layout.GridData;
13import org.eclipse.swt.layout.GridLayout;
14import org.eclipse.swt.widgets.Button;
15import org.eclipse.swt.widgets.Composite;
16import org.eclipse.swt.widgets.Group;
17import org.eclipse.swt.widgets.Label;
18import org.eclipse.swt.widgets.Text;
19 
20import de.uka.ipd.sdq.cip.ConstantsContainer;
21import de.uka.ipd.sdq.cip.runtime.RunConfigImages;
22 
23public class CipConfigTab extends AbstractCipLaunchConfigurationTab {
24 
25        private Label locationLabel;
26        private Text outputPathField;
27        private Button clearButton;
28        private Button checkLoggingButton;
29 
30        @Override
31        public void createControl(Composite parent) {
32                final ModifyListener modifyListener = new ModifyListener(){
33 
34                        public void modifyText(ModifyEvent e) {
35                                CipConfigTab.this.setDirty(true);
36                                CipConfigTab.this.updateLaunchConfigurationDialog();
37                        }
38                };
39                
40                Composite mainComponent = new Composite(parent,SWT.NONE);
41                setControl(mainComponent);
42                mainComponent.setLayout(new GridLayout());
43                
44                /* Copyed from ConfigurationTab */
45                /** Create outPath section */
46                final Group outputPathGroup = new Group(mainComponent, SWT.NONE);
47                outputPathGroup.setText("Completion Plugin ID");
48                final GridLayout gridLayout = new GridLayout();
49                gridLayout.numColumns = 4;
50                outputPathGroup.setLayout(gridLayout);
51                final GridData gd_outputPathGroup = new GridData(SWT.FILL, SWT.CENTER, true, false);
52                outputPathGroup.setLayoutData(gd_outputPathGroup);
53 
54                /** default location button */
55                final Button defaultLocationButton = new Button(outputPathGroup,
56                                SWT.CHECK);
57                final GridData gridData_dl = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1);
58                defaultLocationButton.setLayoutData(gridData_dl);
59                defaultLocationButton.setText("Use default location");
60                defaultLocationButton.setSelection(true);
61                defaultLocationButton.addSelectionListener(new SelectionAdapter() {
62                        
63                        /* (non-Javadoc)
64                         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
65                         */
66                        public void widgetSelected(SelectionEvent e) {
67                                setElementsEnabled(false);
68                                outputPathField.setText(de.uka.ipd.sdq.cip.ConstantsContainer.COMPLETION_DEFAULT_PROJECT_ID);
69 
70                                if (!defaultLocationButton.getSelection()) {
71                                        setElementsEnabled(true);
72                                        outputPathField.setSelection(0);
73 
74                                }
75                        }
76                });
77 
78                locationLabel = new Label(outputPathGroup, SWT.NONE);
79                locationLabel.setLayoutData(new GridData(48, SWT.DEFAULT));
80                locationLabel.setText("Location:");
81 
82                outputPathField = new Text(outputPathGroup, SWT.BORDER);
83                final GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true,
84                                false);
85                gridData.widthHint = 20;
86                outputPathField.setLayoutData(gridData);
87                outputPathField.setText(de.uka.ipd.sdq.cip.ConstantsContainer.COMPLETION_DEFAULT_PROJECT_ID);
88                outputPathField.addModifyListener(modifyListener);
89 
90                /** Clear group*/
91                final Group clearGroup = new Group(mainComponent, SWT.NONE);
92                clearGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
93                clearGroup.setText("Generated models");
94                clearGroup.setLayout(new GridLayout());
95                clearButton = new Button(clearGroup,
96                                SWT.CHECK);
97                clearButton.setLayoutData( new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
98                clearButton.setText("Delete generated models at simulation end");
99                clearButton.setSelection(true);
100                clearButton.addSelectionListener(new SelectionAdapter() {
101                        
102                        /* (non-Javadoc)
103                         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
104                         */
105                        public void widgetSelected(SelectionEvent e) {
106                                CipConfigTab.this.setDirty(true);
107                                CipConfigTab.this.updateLaunchConfigurationDialog();
108                        }
109                });
110                
111                /** Logging group*/
112                final Group loggingGroup = new Group(mainComponent, SWT.NONE);
113                loggingGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
114                loggingGroup.setText("QVT Logging");
115                loggingGroup.setLayout(new GridLayout());
116                checkLoggingButton = new Button(loggingGroup, SWT.CHECK);
117                checkLoggingButton.setText("Enable verbose logging");
118                checkLoggingButton.addSelectionListener(new SelectionAdapter() {
119                        
120                        /* (non-Javadoc)
121                         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
122                         */
123                        public void widgetSelected(SelectionEvent e) {
124                                CipConfigTab.this.setDirty(true);
125                                CipConfigTab.this.updateLaunchConfigurationDialog();
126                        }
127                });
128                checkLoggingButton.setSelection(false);
129                
130                // disabled widget
131                setElementsEnabled(false);
132        }
133                
134        /**
135         * Those makes enabled/disabled for the input the responsible widget
136         */
137        private void setElementsEnabled(boolean enable) {
138                locationLabel.setEnabled(enable);
139                outputPathField.setEnabled(enable);
140        }
141        
142        @Override
143        public String getName() {
144                return "CIP Configuration";
145        }
146        
147        @Override
148        public Image getImage() {
149                return RunConfigImages.getCompletionTabImage();
150        }
151        
152        @Override
153        public void initializeFrom(ILaunchConfiguration configuration) {
154                try {
155                        outputPathField.setText(configuration.getAttribute(
156                                        ConstantsContainer.COMPLETION_PROJECT_ID, de.uka.ipd.sdq.cip.ConstantsContainer.COMPLETION_DEFAULT_PROJECT_ID));
157                } catch (CoreException e) {
158                        //CipPlugin.errorLogger(getName(),"Location", e.getMessage());
159                }
160                try {
161                        clearButton.setSelection(configuration.getAttribute(
162                                        ConstantsContainer.COMPLETION_DELETE_PLUGIN, true));
163                } catch (CoreException e) {
164                        clearButton.setSelection(true);
165                }
166                try {
167                        checkLoggingButton.setSelection(configuration.getAttribute(
168                                        ConstantsContainer.COMPLETION_QVT_VERBOSE_LOGGING, false));
169                } catch (CoreException e) {
170                        checkLoggingButton.setSelection(false);
171                }
172        }
173 
174        @Override
175        public void performApply(ILaunchConfigurationWorkingCopy configuration) {
176                configuration.setAttribute(ConstantsContainer.COMPLETION_PROJECT_ID,
177                                outputPathField.getText());
178                configuration.setAttribute(ConstantsContainer.COMPLETION_DELETE_PLUGIN,
179                                clearButton.getSelection());
180                configuration.setAttribute(ConstantsContainer.COMPLETION_QVT_VERBOSE_LOGGING,
181                                checkLoggingButton.getSelection());
182        }
183 
184        @Override
185        public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {}
186        
187        public boolean isValid(ILaunchConfiguration launchConfig) {
188                setErrorMessage(null);
189 
190                if (outputPathField.getText().equals("")){
191                        setErrorMessage("The output path location is not specified!");
192                        return false;
193                }
194                return true;
195        }
196        
197        @Override
198        public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
199                // Leave this method empty to prevent unnecessary invocation of
200                // initializeFrom() and multiple resulting invocations of
201                // performApply().
202        }
203 
204        @Override
205        public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
206 
207}

[all classes][de.uka.ipd.sdq.cip.runtime.runconfig.tabs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov