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

nameclass, %method, %block, %line, %
DeleteExctentionAction.java0%   (0/2)0%   (0/6)0%   (0/73)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeleteExctentionAction0%   (0/1)0%   (0/4)0%   (0/55)0%   (0/16)
DeleteExctentionAction (Signature): void 0%   (0/1)0%   (0/16)0%   (0/6)
access$0 (DeleteExctentionAction): ExceptionType 0%   (0/1)0%   (0/3)0%   (0/1)
selectionChanged (SelectionChangedEvent): void 0%   (0/1)0%   (0/12)0%   (0/4)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/24)0%   (0/6)
     
class DeleteExctentionAction$10%   (0/1)0%   (0/2)0%   (0/18)0%   (0/4)
DeleteExctentionAction$1 (DeleteExctentionAction, TransactionalEditingDomain,... 0%   (0/1)0%   (0/10)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/8)0%   (0/2)

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.jface.viewers.ISelectionChangedListener;
9import org.eclipse.jface.viewers.IStructuredSelection;
10import org.eclipse.jface.viewers.SelectionChangedEvent;
11import org.eclipse.swt.events.SelectionAdapter;
12import org.eclipse.swt.events.SelectionEvent;
13 
14import de.uka.ipd.sdq.pcm.repository.ExceptionType;
15import de.uka.ipd.sdq.pcm.repository.Signature;
16 
17/** @author roman */
18public class DeleteExctentionAction extends SelectionAdapter implements ISelectionChangedListener {
19 
20        private Signature parentSignature;
21        private ExceptionType exceptionType = null;
22 
23        /**
24         * The transactional editing domain which is used to get the commands and
25         * alter the model
26         */
27        protected TransactionalEditingDomain editingDomain = null;
28 
29        public DeleteExctentionAction(Signature signature) {
30                this.parentSignature = signature;
31                this.editingDomain = TransactionUtil.getEditingDomain(signature);
32        }
33 
34        /* (non-Javadoc)
35         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
36         */
37        public void selectionChanged(SelectionChangedEvent event) {
38                IStructuredSelection sel = (IStructuredSelection) event.getSelection();
39                Object selection = (Object) sel.getFirstElement();
40                this.exceptionType = (ExceptionType) selection;
41        }
42 
43        /* (non-Javadoc)
44         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
45         */
46        @Override
47        public void widgetSelected(SelectionEvent e) {
48                Assert.isNotNull(exceptionType);
49                final EList<ExceptionType> exceptions = parentSignature.getExceptions__Signature();
50                
51                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
52                        @Override
53                        protected void doExecute() {
54                                exceptions.remove(exceptionType);
55                        }
56                };
57 
58                recCommand.setDescription("Delete ...");
59                editingDomain.getCommandStack().execute(recCommand);
60        }
61}

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