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

nameclass, %method, %block, %line, %
OperationAddActionListener.java0%   (0/2)0%   (0/7)0%   (0/67)0%   (0/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OperationAddActionListener0%   (0/1)0%   (0/5)0%   (0/34)0%   (0/12)
OperationAddActionListener (): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$0 (OperationAddActionListener): OperationInterface 0%   (0/1)0%   (0/3)0%   (0/1)
getSelectedInterface (): OperationInterface 0%   (0/1)0%   (0/3)0%   (0/1)
setSelectedInterface (OperationInterface): void 0%   (0/1)0%   (0/4)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/21)0%   (0/7)
     
class OperationAddActionListener$10%   (0/1)0%   (0/2)0%   (0/33)0%   (0/10)
OperationAddActionListener$1 (OperationAddActionListener, TransactionalEditin... 0%   (0/1)0%   (0/7)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/26)0%   (0/8)

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.SelectionAdapter;
8import org.eclipse.swt.events.SelectionEvent;
9 
10import de.uka.ipd.sdq.pcm.repository.OperationInterface;
11import de.uka.ipd.sdq.pcm.repository.OperationSignature;
12import de.uka.ipd.sdq.pcm.repository.RepositoryFactory;
13 
14public class OperationAddActionListener extends SelectionAdapter {
15 
16        /**
17         * Define the selected interface. The variable is set not during the class
18         * production, separates later.
19         */
20        private OperationInterface selectedInterface;
21 
22        /* (non-Javadoc)
23         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
24         */
25        @Override
26        public void widgetSelected(SelectionEvent e) {
27                Assert.isNotNull(selectedInterface);
28 
29                /**
30                 * The transactional editing domain which is used to get the commands
31                 * and alter the model
32                 */
33                TransactionalEditingDomain editingDomain = TransactionUtil
34                                .getEditingDomain(selectedInterface);
35 
36                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
37                        @Override
38                        protected void doExecute() {
39                                OperationSignature signature = RepositoryFactory.eINSTANCE
40                                                .createOperationSignature();
41                                signature
42                                                .setEntityName("ServiceName"
43                                                                + (selectedInterface.getSignatures__OperationInterface()
44                                                                                .size() + 1));
45                                selectedInterface.getSignatures__OperationInterface().add(signature);
46                        }
47                };
48 
49                recCommand.setDescription("Add new signature");
50                editingDomain.getCommandStack().execute(recCommand);
51        }
52 
53        /**
54         * @return the selectedInterface
55         */
56        public OperationInterface getSelectedInterface() {
57                return selectedInterface;
58        }
59 
60        /**
61         * @param selectedInterface the selectedInterface to set
62         */
63        public void setSelectedInterface(OperationInterface selectedInterface) {
64                this.selectedInterface = selectedInterface;
65        }
66}

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