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

nameclass, %method, %block, %line, %
ProvidedRoleEditHelper.java0%   (0/1)0%   (0/2)0%   (0/105)0%   (0/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProvidedRoleEditHelper0%   (0/1)0%   (0/2)0%   (0/105)0%   (0/29)
ProvidedRoleEditHelper (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/102)0%   (0/28)

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

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