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

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InfrastructureProvidedRoleEditHelper0%   (0/1)0%   (0/2)0%   (0/105)0%   (0/32)
InfrastructureProvidedRoleEditHelper (): 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.InfrastructureInterface;
19import de.uka.ipd.sdq.pcm.repository.Repository;
20import de.uka.ipd.sdq.pcm.repository.RepositoryPackage;
21 
22/**
23 * @generated not
24 */
25public class InfrastructureProvidedRoleEditHelper extends
26                PalladioComponentModelBaseEditHelper {
27 
28        @Override
29        protected ICommand getConfigureCommand(ConfigureRequest request) {
30                InfrastructureInterface resource = null;
31 
32                ArrayList<Object> filterList = new ArrayList<Object>();
33                filterList.add(Repository.class);
34                filterList.add(InfrastructureInterface.class);
35 
36                ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
37                PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(
38                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
39                                filterList, additionalReferences, request
40                                                .getElementToConfigure().eResource().getResourceSet());
41                dialog.setProvidedService(InfrastructureInterface.class);
42                dialog.open();
43                if (dialog.getResult() == null)
44                        return new CanceledCommand();
45                if (!(dialog.getResult() instanceof InfrastructureInterface))
46                        return new CanceledCommand();
47                resource = (InfrastructureInterface) dialog.getResult();
48 
49                ICommand cmd = new SetValueCommand(
50                                new SetRequest(
51                                                request.getElementToConfigure(),
52                                                RepositoryPackage.eINSTANCE
53                                                                .getInfrastructureProvidedRole_ProvidedInterface__InfrastructureProvidedRole(),
54                                                resource));
55 
56                String name = "Provided_" + resource.getEntityName();
57 
58                ICommand cmd2 = new SetValueCommand(new SetRequest(request
59                                .getElementToConfigure(), EntityPackage.eINSTANCE
60                                .getNamedElement_EntityName(), name));
61 
62                CompositeCommand cc = new CompositeCommand(
63                                "Configure Infrastructure Provided Role Context");
64                cc.add(cmd);
65                cc.add(cmd2);
66 
67                return cc;
68        }}

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