Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-03-29 14:17:58 -0400
committerAlena Laskavaia2011-03-29 14:17:58 -0400
commit3bceaf6856d88d6d1e02c55173eca6057fb9bd8b (patch)
treed3d00594fad90de468b19d01bf5fb3b31249bfb2 /codan/org.eclipse.cdt.codan.ui.cxx
parent38cea0f9eb4b40090fbcfcf7121b9e28f8513892 (diff)
downloadorg.eclipse.cdt-3bceaf6856d88d6d1e02c55173eca6057fb9bd8b.tar.gz
org.eclipse.cdt-3bceaf6856d88d6d1e02c55173eca6057fb9bd8b.tar.xz
org.eclipse.cdt-3bceaf6856d88d6d1e02c55173eca6057fb9bd8b.zip
added a method to reurn problem instance by marker
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui.cxx')
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
index 12c7e93c94..735537191e 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
@@ -11,6 +11,9 @@
*******************************************************************************/
package org.eclipse.cdt.codan.ui;
+import org.eclipse.cdt.codan.core.CodanRuntime;
+import org.eclipse.cdt.codan.core.model.IProblem;
+import org.eclipse.cdt.codan.core.model.IProblemProfile;
import org.eclipse.cdt.codan.internal.core.model.CodanProblemMarker;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
import org.eclipse.cdt.core.CCorePlugin;
@@ -235,6 +238,16 @@ public abstract class AbstractCodanCMarkerResolution implements ICodanMarkerReso
return CodanProblemMarker.getProblemId(marker);
}
+ public IProblem getProblem(IMarker marker) {
+ IPath path = marker.getResource().getFullPath();
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file == null)
+ return null;
+ IProblemProfile profile = CodanRuntime.getInstance().getCheckersRegistry().getResourceProfile(file);
+ String id = getProblemId(marker);
+ return profile.findProblem(id);
+ }
+
/**
* @param marker
* @return

Back to the top