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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelMarkerNavigationProvider.java]

nameclass, %method, %block, %line, %
PalladioComponentModelMarkerNavigationProvider.java0%   (0/1)0%   (0/4)0%   (0/107)0%   (0/43)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelMarkerNavigationProvider0%   (0/1)0%   (0/4)0%   (0/107)0%   (0/43)
PalladioComponentModelMarkerNavigationProvider (): void 0%   (0/1)0%   (0/3)0%   (0/1)
addMarker (IFile, String, String, String, int): IMarker 0%   (0/1)0%   (0/46)0%   (0/19)
deleteMarkers (IResource): void 0%   (0/1)0%   (0/12)0%   (0/5)
doGotoMarker (IMarker): void 0%   (0/1)0%   (0/46)0%   (0/18)

1/*
2 * Copyright 2007, SDQ, IPD, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.usage.providers;
5 
6import java.util.Arrays;
7import java.util.Map;
8 
9import org.eclipse.core.resources.IFile;
10import org.eclipse.core.resources.IMarker;
11import org.eclipse.core.resources.IResource;
12import org.eclipse.core.runtime.CoreException;
13import org.eclipse.core.runtime.IStatus;
14import org.eclipse.emf.ecore.EObject;
15import org.eclipse.gef.EditPart;
16import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
17import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider;
18 
19import de.uka.ipd.sdq.pcm.gmf.usage.part.PalladioComponentModelDiagramEditorUtil;
20import de.uka.ipd.sdq.pcm.gmf.usage.part.PalladioComponentModelUsageDiagramEditorPlugin;
21 
22/**
23 * @generated
24 */
25public class PalladioComponentModelMarkerNavigationProvider extends
26                AbstractModelMarkerNavigationProvider {
27 
28        /**
29         * @generated
30         */
31        public static final String MARKER_TYPE = PalladioComponentModelUsageDiagramEditorPlugin.ID
32                        + ".diagnostic"; //$NON-NLS-1$
33 
34        /**
35         * @generated
36         */
37        protected void doGotoMarker(IMarker marker) {
38                String elementId = marker
39                                .getAttribute(
40                                                org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID,
41                                                null);
42                if (elementId == null || !(getEditor() instanceof DiagramEditor)) {
43                        return;
44                }
45                DiagramEditor editor = (DiagramEditor) getEditor();
46                Map editPartRegistry = editor.getDiagramGraphicalViewer()
47                                .getEditPartRegistry();
48                EObject targetView = editor.getDiagram().eResource().getEObject(
49                                elementId);
50                if (targetView == null) {
51                        return;
52                }
53                EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView);
54                if (targetEditPart != null) {
55                        PalladioComponentModelDiagramEditorUtil.selectElementsInDiagram(
56                                        editor, Arrays.asList(new EditPart[] { targetEditPart }));
57                }
58        }
59 
60        /**
61         * @generated
62         */
63        public static void deleteMarkers(IResource resource) {
64                try {
65                        resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
66                } catch (CoreException e) {
67                        PalladioComponentModelUsageDiagramEditorPlugin.getInstance()
68                                        .logError("Failed to delete validation markers", e); //$NON-NLS-1$
69                }
70        }
71 
72        /**
73         * @generated
74         */
75        public static IMarker addMarker(IFile file, String elementId,
76                        String location, String message, int statusSeverity) {
77                IMarker marker = null;
78                try {
79                        marker = file.createMarker(MARKER_TYPE);
80                        marker.setAttribute(IMarker.MESSAGE, message);
81                        marker.setAttribute(IMarker.LOCATION, location);
82                        marker
83                                        .setAttribute(
84                                                        org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID,
85                                                        elementId);
86                        int markerSeverity = IMarker.SEVERITY_INFO;
87                        if (statusSeverity == IStatus.WARNING) {
88                                markerSeverity = IMarker.SEVERITY_WARNING;
89                        } else if (statusSeverity == IStatus.ERROR
90                                        || statusSeverity == IStatus.CANCEL) {
91                                markerSeverity = IMarker.SEVERITY_ERROR;
92                        }
93                        marker.setAttribute(IMarker.SEVERITY, markerSeverity);
94                } catch (CoreException e) {
95                        PalladioComponentModelUsageDiagramEditorPlugin.getInstance()
96                                        .logError("Failed to create validation marker", e); //$NON-NLS-1$
97                }
98                return marker;
99        }
100}

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