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

nameclass, %method, %block, %line, %
AssemblyContextEditHelper.java0%   (0/1)0%   (0/2)0%   (0/119)0%   (0/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AssemblyContextEditHelper0%   (0/1)0%   (0/2)0%   (0/119)0%   (0/30)
AssemblyContextEditHelper (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/116)0%   (0/29)

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.composition.CompositionPackage;
17import de.uka.ipd.sdq.pcm.core.entity.EntityPackage;
18import de.uka.ipd.sdq.pcm.dialogs.selection.PalladioSelectEObjectDialog;
19import de.uka.ipd.sdq.pcm.repository.Repository;
20import de.uka.ipd.sdq.pcm.repository.RepositoryComponent;
21 
22/**
23 * @generated not
24 */
25public class AssemblyContextEditHelper extends
26                PalladioComponentModelBaseEditHelper {
27 
28        @Override
29        protected ICommand getConfigureCommand(ConfigureRequest request) {
30                RepositoryComponent resource = null;
31 
32                ArrayList<Object> filterList = new ArrayList<Object>();
33                filterList.add(Repository.class);
34                //filterList.add(ProvidesComponentType.class); // <- what is/was it for?
35                filterList.add(RepositoryComponent.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(RepositoryComponent.class);
43                dialog.open();
44                if (dialog.getResult() == null)
45                        return new CanceledCommand();
46                if (!(dialog.getResult() instanceof RepositoryComponent))
47                        return new CanceledCommand();
48                resource = (RepositoryComponent) dialog.getResult();
49 
50                ICommand cmd = new SetValueCommand(new SetRequest(request
51                                .getElementToConfigure(), CompositionPackage.eINSTANCE
52                                .getAssemblyContext_EncapsulatedComponent__AssemblyContext(),
53                                resource));
54 
55                String allocationName = "Assembly_" + resource.getEntityName();
56                allocationName += " <" + resource.getEntityName() + ">";
57 
58                ICommand cmd2 = new SetValueCommand(new SetRequest(request
59                                .getElementToConfigure(), EntityPackage.eINSTANCE
60                                .getNamedElement_EntityName(), allocationName));
61 
62                CompositeCommand cc = new CompositeCommand("Configure Assembly Context");
63                cc.add(cmd);
64                cc.add(cmd2);
65 
66                return cc;
67        }
68 
69}

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