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

COVERAGE SUMMARY FOR SOURCE FILE [DeleteInnerDeclarationAction.java]

nameclass, %method, %block, %line, %
DeleteInnerDeclarationAction.java0%   (0/2)0%   (0/5)0%   (0/62)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeleteInnerDeclarationAction0%   (0/1)0%   (0/3)0%   (0/42)0%   (0/15)
DeleteInnerDeclarationAction (PalladioDataTypeDialog, TransactionalEditingDom... 0%   (0/1)0%   (0/9)0%   (0/4)
widgetDefaultSelected (SelectionEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/32)0%   (0/10)
     
class DeleteInnerDeclarationAction$10%   (0/1)0%   (0/2)0%   (0/20)0%   (0/4)
DeleteInnerDeclarationAction$1 (DeleteInnerDeclarationAction, TransactionalEd... 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.datatype;
2 
3import org.eclipse.emf.common.util.EList;
4import org.eclipse.emf.transaction.RecordingCommand;
5import org.eclipse.emf.transaction.TransactionalEditingDomain;
6import org.eclipse.swt.events.SelectionEvent;
7import org.eclipse.swt.events.SelectionListener;
8 
9import de.uka.ipd.sdq.pcm.dialogs.parameters.EditorContentsSelectionAction;
10import de.uka.ipd.sdq.pcm.repository.CompositeDataType;
11import de.uka.ipd.sdq.pcm.repository.InnerDeclaration;
12 
13/**
14 * The class define an action, which a InnerDeclaration for the
15 * CompositeDataType delete.
16 * 
17 * @author Roman Andrej
18 */
19public class DeleteInnerDeclarationAction extends EditorContentsSelectionAction
20                implements SelectionListener {
21 
22        private PalladioDataTypeDialog dialog;
23        private TransactionalEditingDomain editingDomain;
24 
25        public DeleteInnerDeclarationAction(PalladioDataTypeDialog dialog, TransactionalEditingDomain editingDomain) {
26                this.dialog = dialog;
27                this.editingDomain = editingDomain;
28        }
29 
30        /* (non-Javadoc)
31         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
32         */
33        public void widgetSelected(SelectionEvent e) {
34 
35                final InnerDeclaration selectedDeclaration = (InnerDeclaration) getSelectedDeclaration();
36                CompositeDataType parentDataType = (CompositeDataType) selectedDeclaration
37                                .eContainer();
38                final EList<InnerDeclaration> declarations = parentDataType
39                                .getInnerDeclaration_CompositeDataType();
40 
41                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
42                        @Override
43                        protected void doExecute() {
44                                declarations.remove(selectedDeclaration);
45                        }
46                };
47 
48                recCommand.setDescription("Delete ...");
49                editingDomain.getCommandStack().execute(recCommand);
50                // validate the innerdeclaration
51                dialog.validateInput();
52        }
53 
54        public void widgetDefaultSelected(SelectionEvent e) {
55                // TODO Auto-generated method stub
56                
57        }
58}

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