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

COVERAGE SUMMARY FOR SOURCE FILE [EventTypeDeleteActionListener.java]

nameclass, %method, %block, %line, %
EventTypeDeleteActionListener.java0%   (0/2)0%   (0/5)0%   (0/61)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EventTypeDeleteActionListener0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/13)
EventTypeDeleteActionListener (): void 0%   (0/1)0%   (0/6)0%   (0/2)
widgetDefaultSelected (SelectionEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/33)0%   (0/10)
     
class EventTypeDeleteActionListener$10%   (0/1)0%   (0/2)0%   (0/21)0%   (0/5)
EventTypeDeleteActionListener$1 (EventTypeDeleteActionListener, Transactional... 0%   (0/1)0%   (0/13)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/8)0%   (0/3)

1package de.uka.ipd.sdq.pcmbench.tabs.operations;
2 
3import org.eclipse.core.runtime.Assert;
4import org.eclipse.emf.transaction.RecordingCommand;
5import org.eclipse.emf.transaction.TransactionalEditingDomain;
6import org.eclipse.emf.transaction.util.TransactionUtil;
7import org.eclipse.swt.events.SelectionEvent;
8import org.eclipse.swt.events.SelectionListener;
9 
10import de.uka.ipd.sdq.pcm.repository.EventGroup;
11import de.uka.ipd.sdq.pcm.repository.EventType;
12import de.uka.ipd.sdq.pcmbench.tabs.generic.SelectionChangedListener;
13 
14public class EventTypeDeleteActionListener extends SelectionChangedListener implements SelectionListener {
15 
16        /**
17         * The transactional editing domain which is used to get the commands and
18         * alter the model
19         */
20        private TransactionalEditingDomain editingDomain = null;
21 
22 
23        /* (non-Javadoc)
24         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
25         */
26        public void widgetSelected(SelectionEvent e) {
27 
28                final EventType selectedEventType = (EventType) getSelectedElement();
29                Assert.isNotNull(selectedEventType);
30                final EventGroup selectedEventGroup = (EventGroup) selectedEventType
31                                .getEventGroup__EventType();
32                Assert.isNotNull(selectedEventGroup);
33                editingDomain = TransactionUtil.getEditingDomain(selectedEventType);
34 
35                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
36                        @Override
37                        protected void doExecute() {
38                                selectedEventGroup.getEventTypes__EventGroup().remove(
39                                                selectedEventType);
40                        }
41                };
42 
43                recCommand.setDescription("Delete ...");
44                editingDomain.getCommandStack().execute(recCommand);
45        }
46 
47        /* (non-Javadoc)
48         * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
49         */
50        public void widgetDefaultSelected(SelectionEvent e) {
51                // The implementation is not necessary.
52        }
53}

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