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

nameclass, %method, %block, %line, %
EventTypeDeleteCellValueListener.java0%   (0/2)0%   (0/5)0%   (0/48)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EventTypeDeleteCellValueListener0%   (0/1)0%   (0/3)0%   (0/32)0%   (0/12)
EventTypeDeleteCellValueListener (TableViewer): void 0%   (0/1)0%   (0/6)0%   (0/3)
widgetDefaultSelected (SelectionEvent): void 0%   (0/1)0%   (0/1)0%   (0/1)
widgetSelected (SelectionEvent): void 0%   (0/1)0%   (0/25)0%   (0/8)
     
class EventTypeDeleteCellValueListener$10%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
EventTypeDeleteCellValueListener$1 (EventTypeDeleteCellValueListener, Transac... 0%   (0/1)0%   (0/10)0%   (0/2)
doExecute (): void 0%   (0/1)0%   (0/6)0%   (0/2)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcmbench.tabs.operations;
5 
6import org.eclipse.emf.transaction.RecordingCommand;
7import org.eclipse.emf.transaction.TransactionalEditingDomain;
8import org.eclipse.emf.transaction.util.TransactionUtil;
9import org.eclipse.jface.viewers.TableViewer;
10import org.eclipse.swt.events.SelectionEvent;
11import org.eclipse.swt.events.SelectionListener;
12 
13import de.uka.ipd.sdq.pcm.repository.EventType;
14import de.uka.ipd.sdq.pcmbench.tabs.generic.SelectionChangedListener;
15 
16/**
17 * Cell value delete listener for event types.
18 * 
19 * @author Benjamin Klatt
20 */
21public class EventTypeDeleteCellValueListener extends SelectionChangedListener implements SelectionListener {
22 
23 
24        private TableViewer viewer;
25        
26        /** Constructor */
27        public EventTypeDeleteCellValueListener(TableViewer viewer) {
28                this.viewer = viewer;
29        }
30 
31        /* (non-Javadoc)
32         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
33         */
34        public void widgetSelected(SelectionEvent e) {
35                
36                final EventType eventType = (EventType) getSelectedElement();
37                
38                TransactionalEditingDomain editingDomain = TransactionUtil
39                                .getEditingDomain(eventType);
40 
41                RecordingCommand recCommand = new RecordingCommand(editingDomain) {
42                        @Override
43                        protected void doExecute() {
44                                eventType.getParameter__EventType().setDataType__Parameter(null);
45                        }
46                };
47 
48                recCommand.setDescription("Set event type parameter type to null");
49                editingDomain.getCommandStack().execute(recCommand);
50                
51                viewer.refresh();
52        }
53 
54        /* (non-Javadoc)
55         * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
56         */
57        public void widgetDefaultSelected(SelectionEvent e) {
58                // The implementation is not necessary.
59        }
60}

[all classes][de.uka.ipd.sdq.pcmbench.tabs.operations]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov