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

COVERAGE SUMMARY FOR SOURCE FILE [SensorFrameworkTab.java]

nameclass, %method, %block, %line, %
SensorFrameworkTab.java0%   (0/3)0%   (0/16)0%   (0/233)0%   (0/62)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SensorFrameworkTab0%   (0/1)0%   (0/12)0%   (0/172)0%   (0/50)
SensorFrameworkTab (): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$0 (SensorFrameworkTab, boolean): void 0%   (0/1)0%   (0/4)0%   (0/1)
access$1 (SensorFrameworkTab): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$2 (SensorFrameworkTab): 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/93)0%   (0/21)
deactivated (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
initializeFrom (ILaunchConfiguration): void 0%   (0/1)0%   (0/38)0%   (0/13)
isValid (ILaunchConfiguration): boolean 0%   (0/1)0%   (0/13)0%   (0/5)
performApply (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/6)0%   (0/3)
setDefaults (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/5)0%   (0/2)
     
class SensorFrameworkTab$10%   (0/1)0%   (0/2)0%   (0/14)0%   (0/5)
SensorFrameworkTab$1 (SensorFrameworkTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
modifyText (ModifyEvent): void 0%   (0/1)0%   (0/8)0%   (0/3)
     
class SensorFrameworkTab$20%   (0/1)0%   (0/2)0%   (0/47)0%   (0/11)
SensorFrameworkTab$2 (SensorFrameworkTab): void 0%   (0/1)0%   (0/6)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/41)0%   (0/9)

1package de.uka.ipd.sdq.pipesandfilters.framework.recorder.sensorframework.launch;
2 
3import org.eclipse.core.runtime.CoreException;
4import org.eclipse.debug.core.ILaunchConfiguration;
5import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
7import org.eclipse.jface.dialogs.Dialog;
8import org.eclipse.swt.SWT;
9import org.eclipse.swt.events.ModifyEvent;
10import org.eclipse.swt.events.ModifyListener;
11import org.eclipse.swt.events.SelectionAdapter;
12import org.eclipse.swt.events.SelectionEvent;
13import org.eclipse.swt.layout.GridData;
14import org.eclipse.swt.layout.GridLayout;
15import org.eclipse.swt.widgets.Button;
16import org.eclipse.swt.widgets.Composite;
17import org.eclipse.swt.widgets.Group;
18import org.eclipse.swt.widgets.Label;
19import org.eclipse.swt.widgets.Text;
20 
21import de.uka.ipd.sdq.sensorframework.SensorFrameworkDataset;
22import de.uka.ipd.sdq.sensorframework.dialogs.dataset.ConfigureDatasourceDialog;
23import de.uka.ipd.sdq.sensorframework.dialogs.dataset.DatasourceListLabelProvider;
24import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory;
25 
26public class SensorFrameworkTab extends AbstractLaunchConfigurationTab {
27 
28        private Text dataField;
29 
30        protected int selectedDataSourceID;
31 
32        @Override
33        public void createControl(Composite parent) {
34                Composite container = new Composite(parent, SWT.NONE);
35                container.setLayout(new GridLayout());
36                setControl(container);
37 
38                final ModifyListener modifyListener = new ModifyListener() {
39 
40                        public void modifyText(ModifyEvent e) {
41                                SensorFrameworkTab.this.setDirty(true);
42                                SensorFrameworkTab.this.updateLaunchConfigurationDialog();
43                        }
44                };
45 
46                final Group dataSetGroup = new Group(container, SWT.NONE);
47                dataSetGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
48                                false));
49                final GridLayout gridLayout_2 = new GridLayout();
50                gridLayout_2.numColumns = 3;
51                dataSetGroup.setLayout(gridLayout_2);
52                dataSetGroup.setText("Data Set");
53 
54                final Label dataSourceLabel = new Label(dataSetGroup, SWT.NONE);
55                dataSourceLabel.setText("Data source:");
56 
57                dataField = new Text(dataSetGroup, SWT.BORDER | SWT.READ_ONLY);
58                dataField
59                                .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
60                dataField.addModifyListener(modifyListener);
61 
62                final Button browseButton = new Button(dataSetGroup, SWT.NONE);
63                browseButton.setText("Browse...");
64                browseButton.addSelectionListener(new SelectionAdapter() {
65 
66                        /*
67                         * (non-Javadoc)
68                         * 
69                         * @see
70                         * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
71                         * .swt.events.SelectionEvent)
72                         */
73                        @Override
74                        public void widgetSelected(SelectionEvent e) {
75                                ConfigureDatasourceDialog dialog = new ConfigureDatasourceDialog(
76                                                e.display.getActiveShell(), "Select Datasource...",
77                                                true);
78                                if (dialog.open() == Dialog.OK) {
79                                        IDAOFactory dataSet = (IDAOFactory) dialog.getResult();
80                                        selectedDataSourceID = (int) dataSet.getID();
81                                        dataField.setText(dataSet.getName() + " ["
82                                                        + dataSet.getID() + " ]");
83                                }
84                        }
85                });
86 
87        }
88 
89        @Override
90        public String getName() {
91                return "SensorFramework";
92        }
93 
94        @Override
95        public void initializeFrom(ILaunchConfiguration configuration) {
96                try {
97                        selectedDataSourceID = configuration.getAttribute(
98                                        SensorFrameworkConfig.DATASOURCE_ID, -1);
99                        if (SensorFrameworkDataset.singleton().getDataSourceByID(
100                                        selectedDataSourceID) == null)
101                                dataField.setText("");
102                        else {
103                                IDAOFactory factory = SensorFrameworkDataset.singleton()
104                                                .getDataSourceByID(selectedDataSourceID);
105                                dataField.setText(DatasourceListLabelProvider
106                                                .dataSetRepresentation(factory));
107                        }
108                } catch (CoreException e) {
109                        selectedDataSourceID = -1;
110                        dataField.setText("");
111                }
112        }
113 
114        @Override
115        public void performApply(ILaunchConfigurationWorkingCopy configuration) {
116                configuration.setAttribute(SensorFrameworkConfig.DATASOURCE_ID,
117                                selectedDataSourceID);
118 
119        }
120 
121        @Override
122        public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
123                configuration.setAttribute(SensorFrameworkConfig.DATASOURCE_ID, -1);
124        }
125 
126        @Override
127        public boolean isValid(ILaunchConfiguration launchConfig) {
128                if (SensorFrameworkDataset.singleton().getDataSourceByID(
129                                selectedDataSourceID) == null) {
130                        setErrorMessage("Data source is missing!");
131                        return false;
132                }
133                return true;
134        }
135        
136        @Override
137        public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
138 
139        @Override
140        public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
141 
142}

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