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

COVERAGE SUMMARY FOR SOURCE FILE [OperationRequiredRoleEditHelper.java]

nameclass, %method, %block, %line, %
OperationRequiredRoleEditHelper.java0%   (0/1)0%   (0/2)0%   (0/105)0%   (0/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OperationRequiredRoleEditHelper0%   (0/1)0%   (0/2)0%   (0/105)0%   (0/32)
OperationRequiredRoleEditHelper (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/102)0%   (0/31)

1/*
2 * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.edit.helpers;
5 
6import java.util.ArrayList;
7 
8import org.eclipse.emf.ecore.EReference;
9import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
10import org.eclipse.gmf.runtime.common.core.command.ICommand;
11import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
12import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
13import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
14import org.eclipse.ui.PlatformUI;
15 
16import de.uka.ipd.sdq.pcm.core.entity.EntityPackage;
17import de.uka.ipd.sdq.pcm.dialogs.selection.PalladioSelectEObjectDialog;
18import de.uka.ipd.sdq.pcm.repository.OperationInterface;
19import de.uka.ipd.sdq.pcm.repository.Repository;
20import de.uka.ipd.sdq.pcm.repository.RepositoryPackage;
21 
22/**
23 * Edit helper for operation required roles.
24 * This edit helper opens a dialog to enable the user to choose the 
25 * operation interface the configured role requires.
26 * 
27 * 
28 * @generated NOT
29 */
30public class OperationRequiredRoleEditHelper extends
31                PalladioComponentModelBaseEditHelper {
32 
33        @Override
34        protected ICommand getConfigureCommand(ConfigureRequest request) {
35                OperationInterface resource = null;
36 
37                ArrayList<Object> filterList = new ArrayList<Object>();
38                filterList.add(Repository.class);
39                filterList.add(OperationInterface.class);
40 
41                ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
42                PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(
43                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
44                                filterList, additionalReferences, request
45                                                .getElementToConfigure().eResource().getResourceSet());
46                dialog.setProvidedService(OperationInterface.class);
47                dialog.open();
48                if (dialog.getResult() == null)
49                        return new CanceledCommand();
50                if (!(dialog.getResult() instanceof OperationInterface))
51                        return new CanceledCommand();
52                resource = (OperationInterface) dialog.getResult();
53 
54                ICommand cmd = new SetValueCommand(
55                                new SetRequest(
56                                                request.getElementToConfigure(),
57                                                RepositoryPackage.eINSTANCE
58                                                                .getOperationRequiredRole_RequiredInterface__OperationRequiredRole(),
59                                                resource));
60 
61                String name = "Required_" + resource.getEntityName();
62 
63                ICommand cmd2 = new SetValueCommand(new SetRequest(request
64                                .getElementToConfigure(), EntityPackage.eINSTANCE
65                                .getNamedElement_EntityName(), name));
66 
67                CompositeCommand cc = new CompositeCommand(
68                                "Configure Required Role Context");
69                cc.add(cmd);
70                cc.add(cmd2);
71 
72                return cc;
73        }
74}

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