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

COVERAGE SUMMARY FOR SOURCE FILE [SelectSchedulingPolicyElementDialog.java]

nameclass, %method, %block, %line, %
SelectSchedulingPolicyElementDialog.java0%   (0/4)0%   (0/13)0%   (0/183)0%   (0/37)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SelectSchedulingPolicyElementDialog0%   (0/1)0%   (0/7)0%   (0/124)0%   (0/27)
SelectSchedulingPolicyElementDialog (Shell): void 0%   (0/1)0%   (0/7)0%   (0/3)
access$0 (SelectSchedulingPolicyElementDialog, SchedulingPolicy): void 0%   (0/1)0%   (0/4)0%   (0/1)
close (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
createButtonsForButtonBar (Composite): void 0%   (0/1)0%   (0/23)0%   (0/5)
createContents (Composite): Control 0%   (0/1)0%   (0/13)0%   (0/4)
createDialogArea (Composite): Control 0%   (0/1)0%   (0/71)0%   (0/13)
getResult (): SchedulingPolicy 0%   (0/1)0%   (0/3)0%   (0/1)
     
class SelectSchedulingPolicyElementDialog$10%   (0/1)0%   (0/2)0%   (0/22)0%   (0/5)
SelectSchedulingPolicyElementDialog$1 (SelectSchedulingPolicyElementDialog, T... 0%   (0/1)0%   (0/9)0%   (0/2)
handleEvent (Event): void 0%   (0/1)0%   (0/13)0%   (0/3)
     
class SelectSchedulingPolicyElementDialog$20%   (0/1)0%   (0/2)0%   (0/26)0%   (0/6)
SelectSchedulingPolicyElementDialog$2 (SelectSchedulingPolicyElementDialog, T... 0%   (0/1)0%   (0/9)0%   (0/2)
handleEvent (Event): void 0%   (0/1)0%   (0/17)0%   (0/4)
     
class SelectSchedulingPolicyElementDialog$30%   (0/1)0%   (0/2)0%   (0/11)0%   (0/4)
SelectSchedulingPolicyElementDialog$3 (SelectSchedulingPolicyElementDialog): ... 0%   (0/1)0%   (0/6)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/5)0%   (0/2)

1package de.uka.ipd.sdq.pcm.dialogs.resource;
2 
3 
4import org.eclipse.jface.dialogs.*;
5import org.eclipse.swt.SWT;
6import org.eclipse.swt.events.SelectionAdapter;
7import org.eclipse.swt.events.SelectionEvent;
8import org.eclipse.swt.layout.*;
9import org.eclipse.swt.widgets.*;
10 
11 
12import de.uka.ipd.sdq.pcm.resourceenvironment.SchedulingPolicy;
13 
14public class SelectSchedulingPolicyElementDialog extends TitleAreaDialog{
15 
16        private SchedulingPolicy policy = null;
17        private Button CANCELbutton;
18        
19        public SelectSchedulingPolicyElementDialog(Shell parentShell/*, SchedulingPolicy policy*/) {
20                super(parentShell);
21                //this.policy = policy;
22        }
23 
24        public boolean close() {
25                return super.close();
26        }
27        
28        protected Control createContents(Composite parent) {
29            Control contents = super.createContents(parent);
30 
31            // Set the title
32            setTitle("Scheduling Policy");
33 
34            // Set the message
35            setMessage("Select a scheduling policy", IMessageProvider.INFORMATION);
36            return contents;
37          }
38        
39        protected Control createDialogArea(Composite parent) {
40            Composite composite = (Composite) super.createDialogArea(parent);
41 
42            // Create a table
43            final Table table = new Table(composite, SWT.FULL_SELECTION | SWT.BORDER);
44            table.setLayoutData(new GridData(GridData.FILL_BOTH));
45 
46            // Create two columns and show
47            TableColumn one = new TableColumn(table, SWT.LEFT);
48            one.setText("Scheduling Policy");
49 
50            table.setHeaderVisible(true);
51 
52            // Add data to table
53            TableItem item;
54            for (SchedulingPolicy pol : SchedulingPolicy.VALUES) {
55                    item = new TableItem(table, SWT.NONE);
56                    item.setText(0,pol.getName());
57            }
58            one.pack();
59            
60            table.addListener(SWT.Selection, new Listener() {
61                public void handleEvent(Event e) {
62                  TableItem[] selection = table.getSelection();
63                  policy = SchedulingPolicy.get(selection[0].getText());
64                }
65              });
66            table.addListener(SWT.DefaultSelection, new Listener() {
67                public void handleEvent(Event e) {
68                  TableItem[] selection = table.getSelection();
69                  policy = SchedulingPolicy.get(selection[0].getText());
70                  close();
71                }
72              });
73 
74            return composite;
75          }
76        
77        protected void createButtonsForButtonBar(Composite parent) {
78                CANCELbutton = createButton(parent, IDialogConstants.CANCEL_ID,
79                                IDialogConstants.CANCEL_LABEL, false);
80                CANCELbutton.addSelectionListener(new SelectionAdapter(){
81 
82                        /* (non-Javadoc)
83                         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
84                         */
85                        @Override
86                        public void widgetSelected(SelectionEvent e) {
87                                policy = null;
88                        }
89                });
90                createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
91        }
92        
93        public SchedulingPolicy getResult() {
94                return policy;
95        }
96 
97}

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