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

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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