'How can show error icon on eclipse editor tab
I add a marker from type error in the problems view and as expected the line was underlined and annotated with an error and on the project explorer view the error icon was displayed. But I expect the error icon also in the tab section, marked as yellow in the screenshot below.
<extension
id="myproject.ui.error"
name="Audit Marker"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
<attribute name="key"/>
<attribute name="violation"/>
</extension>
<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationType="myproject.ui.error"
colorPreferenceKey="squiggles.color"
colorPreferenceValue="253,255,157"
highlightPreferenceKey="squiggles.background"
highlightPreferenceValue="false"
includeOnPreferencePage="false"
label="ErrorSpecification"
overviewRulerPreferenceKey="squiggles.rulers.overview"
overviewRulerPreferenceValue="true"
presentationLayer="4"
textPreferenceKey="squiggles.text"
textPreferenceValue="true"
textStylePreferenceKey="squiggles.text.style"
textStylePreferenceValue="UNDERLINE"
verticalRulerPreferenceKey="squiggles.rulers.vertical"
verticalRulerPreferenceValue="true"/>
</extension>
<extension
point="org.eclipse.ui.editors.annotationTypes">
<type
markerSeverity="2"
markerType="myproject.ui.error"
name="myproject.ui.error"
super="org.eclipse.ui.workbench.texteditor.error"/>
</extension>
public IMarker createMarker(IResource res, int line) throws CoreException {
if (res != null) {
IMarker marker = res.createMarker("myproject.ui.error");
marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
marker.setAttribute(IMarker.MESSAGE, "WrongType");
marker.setAttribute(IMarker.CHAR_START, 0);
marker.setAttribute(IMarker.CHAR_END, 2);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
return marker;
}
return null;
}
Anything missing in the code above?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

