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

COVERAGE SUMMARY FOR SOURCE FILE [AddExceptionTypeAction.java]

nameclass, %method, %block, %line, %
AddExceptionTypeAction.java0%   (0/2)0%   (0/4)0%   (0/69)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddExceptionTypeAction0%   (0/1)0%   (0/2)0%   (0/37)0%   (0/12)
AddExceptionTypeAction (Signature): void 0%   (0/1)0%   (0/13)0%   (0/5)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/24)0%   (0/7)
     
class AddExceptionTypeAction$10%   (0/1)0%   (0/2)0%   (0/32)0%   (0/7)
AddExceptionTypeAction$1 (AddExceptionTypeAction, TransactionalEditingDomain,... 0%   (0/1)0%   (0/10)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/22)0%   (0/5)

1package de.uka.ipd.sdq.pcm.dialogs.exception;
2 
3import org.eclipse.core.runtime.Assert;
4import org.eclipse.emf.common.util.EList;
5import org.eclipse.emf.transaction.RecordingCommand;
6import org.eclipse.emf.transaction.TransactionalEditingDomain;
7import org.eclipse.emf.transaction.util.TransactionUtil;
8import org.eclipse.swt.events.SelectionAdapter;
9import org.eclipse.swt.events.SelectionEvent;
10 
11import de.uka.ipd.sdq.pcm.repository.ExceptionType;
12import de.uka.ipd.sdq.pcm.repository.RepositoryFactory;
13import de.uka.ipd.sdq.pcm.repository.Signature;
14 
15/**
16 * @author roman
17 */
18public class AddExceptionTypeAction extends SelectionAdapter{
19 
20        private Signature parentSignature;
21 
22        /**
23         * The transactional editing domain which is used to get the commands and
24         * alter the model
25         */
26        protected TransactionalEditingDomain editingDomain = null;
27 
28        public AddExceptionTypeAction(Signature parentSignature) {
29                this.parentSignature = parentSignature;
30                this.editingDomain = TransactionUtil.getEditingDomain(parentSignature);
31        }
32 
33        /*
34         * (non-Javadoc)
35         * 
36         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
37         */
38        @Override
39        public void widgetSelected(SelectionEvent e) {
40                Assert.isNotNull(parentSignature);
41 
42                final EList<ExceptionType> exceptions = parentSignature
43                                .getExceptions__Signature();
44 
45                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
46                        @Override
47                        protected void doExecute() {
48                                ExceptionType exceptionType = RepositoryFactory.eINSTANCE
49                                                .createExceptionType();
50                                exceptionType.setExceptionName("ExceptionName" + (exceptions.size() + 1));
51                                exceptions.add(exceptionType);
52                        }
53                };
54 
55                recCommand.setDescription("Add new ExceptionType to the signature");
56                editingDomain.getCommandStack().execute(recCommand);
57        }
58}

[all classes][de.uka.ipd.sdq.pcm.dialogs.exception]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov