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 [OperationDeleteActionListener.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OperationDeleteActionListener0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/13)
OperationDeleteActionListener (): 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 OperationDeleteActionListener$10%   (0/1)0%   (0/2)0%   (0/21)0%   (0/5)
OperationDeleteActionListener$1 (OperationDeleteActionListener, 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.OperationInterface;
11import de.uka.ipd.sdq.pcm.repository.OperationSignature;
12import de.uka.ipd.sdq.pcmbench.tabs.generic.SelectionChangedListener;
13 
14public class OperationDeleteActionListener 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 OperationSignature selectedSignature = (OperationSignature) getSelectedElement();
29                Assert.isNotNull(selectedSignature);
30                final OperationInterface selectedInterface = (OperationInterface) selectedSignature
31                                .getInterface__OperationSignature();
32                Assert.isNotNull(selectedInterface);
33                editingDomain = TransactionUtil.getEditingDomain(selectedSignature);
34 
35                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
36                        @Override
37                        protected void doExecute() {
38                                selectedInterface.getSignatures__OperationInterface().remove(
39                                                selectedSignature);
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