Hi,
I am facing a strange problem while adding custom eclipse marker. The scenario is that while adding marker, when a resource(To which I need to add marker) is open then Marker icon is visible. But if the resource is not open then marker is added but icon is not visible.
Here is a snippet of code I am using
<extension
id="HighPriority"
name="High Priority problem"
point="org.eclipse.core.resources.markers">
<persistent value="true">
</persistent>
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="org.eclipse.core.resources.textmarker"/>
</extension>
<extension point="org.eclipse.ui.editors.annotationTypes">
<type
name="X.X.X.HighPriorityAnnotation"
super="org.eclipse.ui.workbench.texteditor.warning"
markerType="X.X.X.HighPriority"/>
</extension>
<extension point="X.X.X.markerAnnotationSpecification">
<specification
annotationType="X.X.X.HighPriorityAnnotation"
icon="icons\img.gif"
/>
</extension>
And code for creating marker is
IMarker marker = markerNode.getTargetFile().createMarker(markerNode.getPriority().getMarkerName());
Map<String, Object> attributes = new HashMap<String,Object>();
attributes.put(IMarker.LINE_NUMBER, markerNode.getLineNumber());
attributes.put(IMarker.SEVERITY, Integer.valueOf(IMarker.SEVERITY_WARNING));
attributes.put(IMarker.MESSAGE, markerNode.getMessage());
attributes.put(IMarker.PRIORITY, Integer.valueOf(IMarker.PRIORITY_HIGH));
marker.setAttributes(attributes);
To open editor I using following code
IDE.openEditor(this.getSite().getPage(), marker, OpenStrategy.activateOnOpen());
Do I need to do anything else while opening editor??
Any Suggestions...???