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

COVERAGE SUMMARY FOR SOURCE FILE [WizardSelectDatasourcePage.java]

nameclass, %method, %block, %line, %
WizardSelectDatasourcePage.java0%   (0/2)0%   (0/11)0%   (0/217)0%   (0/50)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class WizardSelectDatasourcePage0%   (0/1)0%   (0/8)0%   (0/169)0%   (0/41)
<static initializer> 0%   (0/1)0%   (0/5)0%   (0/3)
WizardSelectDatasourcePage (String, boolean, boolean, boolean): void 0%   (0/1)0%   (0/19)0%   (0/7)
access$0 (WizardSelectDatasourcePage): Combo 0%   (0/1)0%   (0/3)0%   (0/1)
canFlipToNextPage (): boolean 0%   (0/1)0%   (0/31)0%   (0/4)
createControl (Composite): void 0%   (0/1)0%   (0/34)0%   (0/9)
createPageContent (Composite): void 0%   (0/1)0%   (0/59)0%   (0/11)
getResult (): String 0%   (0/1)0%   (0/3)0%   (0/1)
populateComboBox (): void 0%   (0/1)0%   (0/15)0%   (0/5)
     
class WizardSelectDatasourcePage$10%   (0/1)0%   (0/3)0%   (0/48)0%   (0/10)
WizardSelectDatasourcePage$1 (WizardSelectDatasourcePage): void 0%   (0/1)0%   (0/6)0%   (0/2)
widgetDefaultSelected (SelectionEvent): void 0%   (0/1)0%   (0/21)0%   (0/4)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/21)0%   (0/4)

1package de.uka.ipd.sdq.sensorframework.dialogs.dataset;
2 
3import org.eclipse.jface.wizard.WizardPage;
4import org.eclipse.swt.SWT;
5import org.eclipse.swt.events.SelectionEvent;
6import org.eclipse.swt.events.SelectionListener;
7import org.eclipse.swt.layout.GridData;
8import org.eclipse.swt.layout.GridLayout;
9import org.eclipse.swt.widgets.Combo;
10import org.eclipse.swt.widgets.Composite;
11import org.eclipse.swt.widgets.Label;
12 
13public class WizardSelectDatasourcePage extends WizardPage {
14 
15        /**String constants for existing data sources */
16        public static String MEMORY_DATASRC = "Memory Datasource";
17        public static String FILE_DATASRC = "File Datasource";
18        
19        private Combo myCombo;
20        protected String result = "";
21        private String pageName;
22        private boolean memoryEntry, db40Entry, fileEntry;
23 
24        protected WizardSelectDatasourcePage(String pageName, boolean memoryEntry,
25                        boolean db40Entry, boolean fileEntry) {
26                super(pageName);
27                this.pageName = pageName;
28                this.memoryEntry = memoryEntry;
29                this.db40Entry = db40Entry;
30                this.fileEntry = fileEntry;
31        }
32 
33        
34        /* (non-Javadoc)
35         * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
36         */
37        public void createControl(Composite parent) {
38                
39                initializeDialogUnits(parent);
40                Composite topLevel = new Composite(parent, SWT.NONE);
41                topLevel.setLayout(new GridLayout());
42                topLevel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
43                                | GridData.HORIZONTAL_ALIGN_FILL));
44                topLevel.setFont(parent.getFont());
45                setControl(topLevel);
46                createPageContent(topLevel);
47                this.setPageComplete(false);
48        }
49 
50        private void createPageContent(Composite parent) {
51                Composite panel = new Composite(parent, SWT.NONE);
52                panel.setLayoutData(new GridData(GridData.FILL_BOTH));
53                GridLayout layout = new GridLayout();
54                panel.setLayout(layout);
55 
56                Label label = new Label(panel, SWT.NONE);
57                label.setText(pageName + ":");
58                label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
59 
60                myCombo = new Combo(panel, SWT.DROP_DOWN | SWT.READ_ONLY);
61                populateComboBox();
62                myCombo.addSelectionListener(new SelectionListener() {
63 
64                        public void widgetDefaultSelected(SelectionEvent e) {
65                                WizardSelectDatasourcePage.this.result = myCombo.getText();
66                                WizardSelectDatasourcePage.this.setPageComplete(!myCombo
67                                                .getText().equals(""));
68                        }
69 
70                        public void widgetSelected(SelectionEvent e) {
71                                WizardSelectDatasourcePage.this.result = myCombo.getText();
72                                WizardSelectDatasourcePage.this.setPageComplete(!myCombo
73                                                .getText().equals(""));
74                        }
75 
76                });
77        }
78 
79        private void populateComboBox() {
80                if (memoryEntry)
81                        myCombo.add(MEMORY_DATASRC);
82                if (fileEntry)
83                        myCombo.add(FILE_DATASRC);
84        }
85 
86        
87        /* (non-Javadoc)
88         * @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()
89         */
90        @Override
91        public boolean canFlipToNextPage() {
92                boolean canFlip = !myCombo.getText().equals("");
93                canFlip = canFlip
94                                && (myCombo.getText().equals(FILE_DATASRC));
95 
96                return super.canFlipToNextPage() && canFlip;
97        }
98 
99        public String getResult() {
100                return result;
101        }
102}

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