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

COVERAGE SUMMARY FOR SOURCE FILE [EntryLevelSystemCallEditHelperAdvice.java]

nameclass, %method, %block, %line, %
EntryLevelSystemCallEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/121)0%   (0/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EntryLevelSystemCallEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/121)0%   (0/35)
EntryLevelSystemCallEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getAfterConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/118)0%   (0/34)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcm.gmf.usage.helper;
5 
6import java.util.ArrayList;
7 
8import org.eclipse.emf.ecore.EReference;
9import org.eclipse.gmf.runtime.common.core.command.ICommand;
10import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
11import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
12import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
13import org.eclipse.ui.PlatformUI;
14 
15import de.uka.ipd.sdq.pcm.dialogs.selection.PalladioSelectEObjectDialog;
16import de.uka.ipd.sdq.pcm.repository.OperationInterface;
17import de.uka.ipd.sdq.pcm.repository.OperationProvidedRole;
18import de.uka.ipd.sdq.pcm.repository.OperationSignature;
19import de.uka.ipd.sdq.pcm.repository.RepositoryPackage;
20import de.uka.ipd.sdq.pcm.system.System;
21 
22/**
23 * @author roman, Christian Busch
24 * @generated NOT
25 */
26public class EntryLevelSystemCallEditHelperAdvice extends
27                AbstractEditHelperAdvice implements IEditHelperAdvice {
28 
29        /** 
30         * This command opens two selection dialogs for choosing the system operation provided role and interface.
31         * 
32         */
33        @Override
34        protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
35                
36                OperationSignature signature = null;
37                OperationProvidedRole providedRole = null;
38                ArrayList<Object> filterList = new ArrayList<Object>();
39                filterList.add(System.class);
40                filterList.add(OperationProvidedRole.class);
41 
42                /* first dialog for selection of the operation provided role */
43                ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
44                additionalReferences.add(RepositoryPackage.eINSTANCE
45                                .getOperationProvidedRole_ProvidedInterface__OperationProvidedRole());
46 
47                PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(
48                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
49                                filterList, additionalReferences, request.getEditingDomain()
50                                                .getResourceSet());
51                dialog.setProvidedService(OperationProvidedRole.class);
52                dialog.open();
53                if (dialog.getResult() == null)
54                        return new CanceledCommand();
55                if (!(dialog.getResult() instanceof OperationProvidedRole))        
56                        return new CanceledCommand();
57                
58                providedRole = (OperationProvidedRole)dialog.getResult();
59                
60                /* second dialog for selection of the signature of the interface */
61                filterList.clear();
62                filterList.add(OperationProvidedRole.class);
63                filterList.add(OperationInterface.class);
64                filterList.add(OperationSignature.class);
65                
66                dialog = new PalladioSelectEObjectDialog(
67                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
68                                filterList, additionalReferences, providedRole);
69                dialog.setProvidedService(OperationSignature.class);
70                dialog.open();
71                if (dialog.getResult() == null)
72                        return new CanceledCommand();
73                if (!(dialog.getResult() instanceof OperationSignature))
74                        return new CanceledCommand();
75                signature = (OperationSignature) dialog.getResult();
76                
77                
78                return new EntryLevelSystemCallConfigureCommand(request,signature,providedRole);
79        }
80}

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