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

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