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

COVERAGE SUMMARY FOR SOURCE FILE [DockStatusViewPart.java]

nameclass, %method, %block, %line, %
DockStatusViewPart.java0%   (0/3)0%   (0/12)0%   (0/172)0%   (0/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DockStatusViewPart0%   (0/1)0%   (0/8)0%   (0/96)0%   (0/23)
DockStatusViewPart (): void 0%   (0/1)0%   (0/8)0%   (0/2)
access$0 (DockStatusViewPart): HashMap 0%   (0/1)0%   (0/3)0%   (0/1)
access$1 (DockStatusViewPart): Composite 0%   (0/1)0%   (0/3)0%   (0/1)
createActions (): void 0%   (0/1)0%   (0/1)0%   (0/1)
createPartControl (Composite): void 0%   (0/1)0%   (0/44)0%   (0/8)
dispose (): void 0%   (0/1)0%   (0/7)0%   (0/3)
setFocus (): void 0%   (0/1)0%   (0/1)0%   (0/1)
update (Observable, Object): void 0%   (0/1)0%   (0/29)0%   (0/7)
     
class DockStatusViewPart$10%   (0/1)0%   (0/2)0%   (0/37)0%   (0/7)
DockStatusViewPart$1 (DockStatusViewPart, DockAddedEvent): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/28)0%   (0/5)
     
class DockStatusViewPart$20%   (0/1)0%   (0/2)0%   (0/39)0%   (0/8)
DockStatusViewPart$2 (DockStatusViewPart, DockDeletedEvent): void 0%   (0/1)0%   (0/9)0%   (0/2)
run (): void 0%   (0/1)0%   (0/30)0%   (0/6)

1package de.uka.ipd.sdq.codegen.simucontroller.gui;
2 
3import java.util.HashMap;
4import java.util.Observable;
5import java.util.Observer;
6 
7import org.eclipse.swt.SWT;
8import org.eclipse.swt.layout.FillLayout;
9import org.eclipse.swt.widgets.Composite;
10import org.eclipse.ui.PlatformUI;
11import org.eclipse.ui.part.ViewPart;
12 
13import de.uka.ipd.sdq.codegen.simucontroller.SimuControllerPlugin;
14import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.DockModel;
15import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.DocksModel;
16import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockAddedEvent;
17import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockDeletedEvent;
18 
19public class DockStatusViewPart extends ViewPart implements Observer {
20 
21        public static final String ID = "de.uka.ipd.sdq.codegen.simucontroller.gui.DockStatusViewPart"; //$NON-NLS-1$
22        private HashMap<String,DockStatusViewer> viewers = new HashMap<String, DockStatusViewer>();
23        private DocksModel model;
24        private Composite container;
25 
26        /**
27         * Create contents of the view part
28         * @param parent
29         */
30        @Override
31        public void createPartControl(Composite parent) {
32                container = new Composite(parent, SWT.NONE);
33                container.setLayout(new FillLayout());
34                model = SimuControllerPlugin.getDockModel();
35                
36                for(DockModel dock : model.getAllDocks()) {
37                        update(model,new DockAddedEvent(dock));
38                }
39                model.addObserver(this);
40                
41                createActions();
42        }
43        
44        @Override
45        public void dispose() {
46                model.deleteObserver(this);
47                super.dispose();
48        }
49 
50        /**
51         * Create the actions
52         */
53        private void createActions() {
54                // Create the actions
55        }
56 
57        @Override
58        public void setFocus() {
59                // Set the focus
60        }
61 
62        public void update(Observable o, Object arg) {
63                if (arg instanceof DockAddedEvent) {
64                        final DockAddedEvent addedEvent = (DockAddedEvent) arg;
65                        PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
66 
67                                public void run() {
68                                        DockStatusViewPart.this.viewers.put(addedEvent.getDock().getID(), 
69                                                        new DockStatusViewer(addedEvent.getDock(),container,SWT.NONE));
70                                        container.layout();
71                                        container.redraw();
72                                }
73                                
74                        });
75                }
76                if (arg instanceof DockDeletedEvent) {
77                        final DockDeletedEvent deleteEvent = (DockDeletedEvent) arg;
78                        PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
79 
80                                public void run() {
81                                        DockStatusViewer viewer = DockStatusViewPart.this.viewers.get(deleteEvent.getDock().getID());
82                                        DockStatusViewPart.this.viewers.remove(deleteEvent.getDock().getID());
83                                        viewer.dispose();
84                                        container.layout();
85                                        container.redraw();
86                                }
87                                
88                        });
89                }
90        }
91 
92}

[all classes][de.uka.ipd.sdq.codegen.simucontroller.gui]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov