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

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InfrastructureSignatureDeleteActionListener0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/13)
InfrastructureSignatureDeleteActionListener (): 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 InfrastructureSignatureDeleteActionListener$10%   (0/1)0%   (0/2)0%   (0/21)0%   (0/5)
InfrastructureSignatureDeleteActionListener$1 (InfrastructureSignatureDeleteA... 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.InfrastructureInterface;
11import de.uka.ipd.sdq.pcm.repository.InfrastructureSignature;
12import de.uka.ipd.sdq.pcmbench.tabs.generic.SelectionChangedListener;
13 
14/**Removes selected signatures from an infrastructure interface.
15 * @author groenda
16 *
17 */
18public class InfrastructureSignatureDeleteActionListener extends SelectionChangedListener implements SelectionListener {
19 
20        /**
21         * The transactional editing domain which is used to get the commands and
22         * alter the model
23         */
24        private TransactionalEditingDomain editingDomain = null;
25 
26 
27        /* (non-Javadoc)
28         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
29         */
30        public void widgetSelected(SelectionEvent e) {
31 
32                final InfrastructureSignature selectedSignature = (InfrastructureSignature) getSelectedElement();
33                Assert.isNotNull(selectedSignature);
34                final InfrastructureInterface selectedInterface = (InfrastructureInterface) selectedSignature
35                                .getInfrastructureInterface__InfrastructureSignature();
36                Assert.isNotNull(selectedInterface);
37                editingDomain = TransactionUtil.getEditingDomain(selectedSignature);
38 
39                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
40                        @Override
41                        protected void doExecute() {
42                                selectedInterface.getInfrastructureSignatures__InfrastructureInterface().remove(
43                                                selectedSignature);
44                        }
45                };
46 
47                recCommand.setDescription("Delete ...");
48                editingDomain.getCommandStack().execute(recCommand);
49        }
50 
51        /* (non-Javadoc)
52         * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
53         */
54        public void widgetDefaultSelected(SelectionEvent e) {
55                // The implementation is not necessary.
56        }
57}

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