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

COVERAGE SUMMARY FOR SOURCE FILE [DeleteParameterAction.java]

nameclass, %method, %block, %line, %
DeleteParameterAction.java0%   (0/2)0%   (0/5)0%   (0/60)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeleteParameterAction0%   (0/1)0%   (0/3)0%   (0/40)0%   (0/12)
DeleteParameterAction (Signature): void 0%   (0/1)0%   (0/13)0%   (0/5)
widgetDefaultSelected (SelectionEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/26)0%   (0/6)
     
class DeleteParameterAction$10%   (0/1)0%   (0/2)0%   (0/20)0%   (0/4)
DeleteParameterAction$1 (DeleteParameterAction, TransactionalEditingDomain, E... 0%   (0/1)0%   (0/13)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/7)0%   (0/2)

1package de.uka.ipd.sdq.pcm.dialogs.parameters;
2 
3import org.eclipse.emf.common.util.EList;
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.Parameter;
11import de.uka.ipd.sdq.pcm.repository.Signature;
12 
13/**
14 * The class define an action, which a parameter for the signature delete.
15 * 
16 * @author Roman Andrej
17 */
18public class DeleteParameterAction extends EditorContentsSelectionAction
19                implements SelectionListener {
20 
21        private Signature parentSignature;
22 
23        /**
24         * The transactional editing domain which is used to get the commands and
25         * alter the model
26         */
27        private TransactionalEditingDomain editingDomain = null;
28 
29        public DeleteParameterAction(Signature signature) {
30                this.parentSignature = signature;
31                this.editingDomain = TransactionUtil.getEditingDomain(signature);
32        }
33 
34        /* (non-Javadoc)
35         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
36         */
37        public void widgetSelected(SelectionEvent e) {
38                final Parameter selectedParameter = (Parameter) getSelectedDeclaration();
39                final EList<Parameter> parameters = ParametersUtil.getParametersOfSignature(parentSignature);
40 
41                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
42                        @Override
43                        protected void doExecute() {
44                                parameters.remove(selectedParameter);
45                        }
46                };
47 
48                recCommand.setDescription("Delete ...");
49                editingDomain.getCommandStack().execute(recCommand);
50        }
51 
52        public void widgetDefaultSelected(SelectionEvent e) {
53                // TODO Auto-generated method stub
54                
55        }
56}

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