EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmbench.ui.provider.categoryaware]

COVERAGE SUMMARY FOR SOURCE FILE [PalladioCategoryDescriptions.java]

nameclass, %method, %block, %line, %
PalladioCategoryDescriptions.java0%   (0/1)0%   (0/3)0%   (0/117)0%   (0/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioCategoryDescriptions0%   (0/1)0%   (0/3)0%   (0/117)0%   (0/26)
PalladioCategoryDescriptions (): void 0%   (0/1)0%   (0/3)0%   (0/2)
getCategoriesForObject (EObject): Collection 0%   (0/1)0%   (0/105)0%   (0/23)
hasCategoriesForObject (EObject): boolean 0%   (0/1)0%   (0/9)0%   (0/1)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcmbench.ui.provider.categoryaware;
5 
6import java.util.ArrayList;
7import java.util.Collection;
8import java.util.Collections;
9 
10import org.eclipse.emf.ecore.EObject;
11 
12import de.uka.ipd.sdq.pcm.core.composition.AssemblyConnector;
13import de.uka.ipd.sdq.pcm.core.composition.AssemblyContext;
14import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage;
15import de.uka.ipd.sdq.pcm.core.entity.EntityPackage;
16import de.uka.ipd.sdq.pcm.repository.BasicComponent;
17import de.uka.ipd.sdq.pcm.repository.CompositeComponent;
18import de.uka.ipd.sdq.pcm.repository.Interface;
19import de.uka.ipd.sdq.pcm.repository.ProvidedRole;
20import de.uka.ipd.sdq.pcm.repository.ProvidesComponentType;
21import de.uka.ipd.sdq.pcm.repository.Repository;
22import de.uka.ipd.sdq.pcm.repository.RepositoryPackage;
23import de.uka.ipd.sdq.pcm.repository.RequiredRole;
24import de.uka.ipd.sdq.pcm.seff.ServiceEffectSpecification;
25 
26/**
27 * @author Snowball
28 *
29 */
30public class PalladioCategoryDescriptions implements ICategoryDescriptions {
31 
32        /**
33         * 
34         */
35        public PalladioCategoryDescriptions() {
36        }
37 
38        public Collection<CategoryDescriptor> getCategoriesForObject(EObject object) {
39                if (object instanceof Repository)
40                {
41                        ArrayList<CategoryDescriptor> result = new ArrayList<CategoryDescriptor>();
42                        result.add(new CategoryDescriptor(Repository.class, Interface.class, 
43                                        RepositoryPackage.eINSTANCE.getRepository_Interfaces__Repository(), "Interfaces" ));
44                        result.add(new CategoryDescriptor(Repository.class, ProvidesComponentType.class, 
45                                        RepositoryPackage.eINSTANCE.getRepository_Components__Repository(), "Components" ));
46                        return Collections.unmodifiableCollection(result);
47                }
48                if (object instanceof ProvidesComponentType)
49                {
50                        ArrayList<CategoryDescriptor> result = new ArrayList<CategoryDescriptor>();
51                        result.add(new CategoryDescriptor(ProvidesComponentType.class, ProvidedRole.class, 
52                                        EntityPackage.eINSTANCE.getInterfaceProvidingEntity_ProvidedRoles_InterfaceProvidingEntity(), "Provided Roles" ));
53                        result.add(new CategoryDescriptor(ProvidesComponentType.class, RequiredRole.class, 
54                                        EntityPackage.eINSTANCE.getInterfaceRequiringEntity_RequiredRoles_InterfaceRequiringEntity(), "Required Roles" ));
55                        if (object instanceof BasicComponent)
56                        {
57                                result.add(new CategoryDescriptor(BasicComponent.class, ServiceEffectSpecification.class, 
58                                                RepositoryPackage.eINSTANCE.getBasicComponent_ServiceEffectSpecifications__BasicComponent(), "Service Effect Specifications" ));
59                        }
60                        if (object instanceof CompositeComponent)
61                        {
62                                result.add(new CategoryDescriptor(CompositeComponent.class, AssemblyContext.class, 
63                                                CompositionPackage.eINSTANCE.getAssemblyContext_EncapsulatedComponent__AssemblyContext(), "Child Component Contexts" ));
64                                result.add(new CategoryDescriptor(CompositeComponent.class, AssemblyConnector.class, 
65                                                CompositionPackage.eINSTANCE.getComposedStructure_Connectors__ComposedStructure(), "Assembly Connectors" ));
66                        }
67                        return Collections.unmodifiableCollection(result);
68                }
69                return Collections.EMPTY_LIST;
70        }
71 
72        public boolean hasCategoriesForObject(EObject object) {
73                return getCategoriesForObject(object).size() > 0;
74        }
75}

[all classes][de.uka.ipd.sdq.pcmbench.ui.provider.categoryaware]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov