EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.allocation.view.factories]

COVERAGE SUMMARY FOR SOURCE FILE [ResourceContainerViewFactory.java]

nameclass, %method, %block, %line, %
ResourceContainerViewFactory.java0%   (0/1)0%   (0/3)0%   (0/89)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceContainerViewFactory0%   (0/1)0%   (0/3)0%   (0/89)0%   (0/36)
ResourceContainerViewFactory (): void 0%   (0/1)0%   (0/3)0%   (0/1)
createStyles (View): List 0%   (0/1)0%   (0/11)0%   (0/3)
decorateView (View, View, IAdaptable, String, int, boolean): void 0%   (0/1)0%   (0/75)0%   (0/32)

1/*
2 *Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.view.factories;
5 
6import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.AllocationComponentLabelEditPart;
7import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.AllocationEditPart;
8import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.ResourceContainerAllocationCompartmentEditPart;
9import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.ResourceContainerEditPart;
10import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.ResourceContainerEntityNameEditPart;
11 
12import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelVisualIDRegistry;
13 
14import java.util.ArrayList;
15import java.util.List;
16 
17import org.eclipse.core.runtime.IAdaptable;
18 
19import org.eclipse.emf.ecore.EAnnotation;
20import org.eclipse.emf.ecore.EObject;
21import org.eclipse.emf.ecore.EcoreFactory;
22 
23import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
24 
25import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
26 
27import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
28import org.eclipse.gmf.runtime.notation.NotationFactory;
29import org.eclipse.gmf.runtime.notation.View;
30 
31/**
32 * @generated
33 */
34public class ResourceContainerViewFactory extends AbstractShapeViewFactory {
35 
36        /**
37         * @generated 
38         */
39        protected List createStyles(View view) {
40                List styles = new ArrayList();
41                styles.add(NotationFactory.eINSTANCE.createShapeStyle());
42                return styles;
43        }
44 
45        /**
46         * @generated
47         */
48        protected void decorateView(View containerView, View view,
49                        IAdaptable semanticAdapter, String semanticHint, int index,
50                        boolean persisted) {
51                if (semanticHint == null) {
52                        semanticHint = PalladioComponentModelVisualIDRegistry
53                                        .getType(ResourceContainerEditPart.VISUAL_ID);
54                        view.setType(semanticHint);
55                }
56                super.decorateView(containerView, view, semanticAdapter, semanticHint,
57                                index, persisted);
58                if (!AllocationEditPart.MODEL_ID
59                                .equals(PalladioComponentModelVisualIDRegistry
60                                                .getModelID(containerView))) {
61                        EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
62                                        .createEAnnotation();
63                        shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
64                        shortcutAnnotation.getDetails().put(
65                                        "modelID", AllocationEditPart.MODEL_ID); //$NON-NLS-1$
66                        view.getEAnnotations().add(shortcutAnnotation);
67                }
68                IAdaptable eObjectAdapter = null;
69                EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
70                if (eObject != null) {
71                        eObjectAdapter = new EObjectAdapter(eObject);
72                }
73                getViewService()
74                                .createNode(
75                                                eObjectAdapter,
76                                                view,
77                                                PalladioComponentModelVisualIDRegistry
78                                                                .getType(ResourceContainerEntityNameEditPart.VISUAL_ID),
79                                                ViewUtil.APPEND, true, getPreferencesHint());
80                getViewService()
81                                .createNode(
82                                                eObjectAdapter,
83                                                view,
84                                                PalladioComponentModelVisualIDRegistry
85                                                                .getType(ResourceContainerAllocationCompartmentEditPart.VISUAL_ID),
86                                                ViewUtil.APPEND, true, getPreferencesHint());
87        }
88 
89}

[all classes][de.uka.ipd.sdq.pcm.gmf.allocation.view.factories]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov