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

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InfrastructureSignatureAddActionListener0%   (0/1)0%   (0/5)0%   (0/34)0%   (0/12)
InfrastructureSignatureAddActionListener (): void 0%   (0/1)0%   (0/3)0%   (0/1)
access$0 (InfrastructureSignatureAddActionListener): InfrastructureInterface 0%   (0/1)0%   (0/3)0%   (0/1)
getSelectedInterface (): InfrastructureInterface 0%   (0/1)0%   (0/3)0%   (0/1)
setSelectedInterface (InfrastructureInterface): void 0%   (0/1)0%   (0/4)0%   (0/2)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/21)0%   (0/7)
     
class InfrastructureSignatureAddActionListener$10%   (0/1)0%   (0/2)0%   (0/33)0%   (0/10)
InfrastructureSignatureAddActionListener$1 (InfrastructureSignatureAddActionL... 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.InfrastructureInterface;
11import de.uka.ipd.sdq.pcm.repository.InfrastructureSignature;
12import de.uka.ipd.sdq.pcm.repository.RepositoryFactory;
13 
14public class InfrastructureSignatureAddActionListener extends SelectionAdapter {
15 
16        /**
17         * Define the selected interface. The variable is set not during the class
18         * production, separates later.
19         */
20        private InfrastructureInterface 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                                InfrastructureSignature signature = RepositoryFactory.eINSTANCE
40                                                .createInfrastructureSignature();
41                                signature
42                                                .setEntityName("Signature"
43                                                                + (selectedInterface.getInfrastructureSignatures__InfrastructureInterface()
44                                                                                .size() + 1));
45                                selectedInterface.getInfrastructureSignatures__InfrastructureInterface().add(signature);
46                        }
47                };
48 
49                recCommand.setDescription("Add new infrastructure signature");
50                editingDomain.getCommandStack().execute(recCommand);
51        }
52 
53        /**
54         * @return the selected infrastructure interface
55         */
56        public InfrastructureInterface getSelectedInterface() {
57                return selectedInterface;
58        }
59 
60        /**
61         * @param selectedInterface the selected infrastructure interface to set
62         */
63        public void setSelectedInterface(InfrastructureInterface 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