views:

24

answers:

1

Hi everyone!

I got many ideas from previous question (http://stackoverflow.com/questions/3178996/how-to-display-an-error-sign-on-the-package-when-the-package-has-wrong-informatio)

But the Problem Marker is not displayed.

My interested resource is XML file.

So I add listener for PRE_BUILD means using following code.

addResourceChangedListener(xxx, IResourceChangeEvent.PRE_BUILD)

It works fine So.. Now I can try to add Problem Marker.

IMarker marker = file.createMarker(PROBLEM_ID);

marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); marker.setAttribute(IMarker.MESSAGE, "Error Message"); marker.setAttribute(IMarker.CHAR_START, 5); marker.setAttribute(IMarker.CHAR_END, 6); marker.setAttribute(IMarker.LINE_NUMBER, 5);

Above code is executed. But the Problem Marker is not displayed on the EDITOR and PROBLEM VIEW. How can I show the Problem Marker properly?

+1  A: 

If you add your marker upon IResourceChangeEvent.PRE_BUILD I could imagine the problem is that before a build, all markers are cleared - so perhaps your new markers are cleared immediately so you don't even see them. I'd give it a try with IResourceChangeEvent.POST_BUILD.

Also, are you using the correct problem ID when creating the marker? Because in your code you use createMarker(PROBLEM_ID), not createMarker(IMarker.PROBLEM).

Fabian Steeg
Thanks for your response. I used 'POST_BUILD' also. I have looked in to this problem from the beginning. Finally I got the Problem Marker. The reason of that is "PROBLEM_ID" in the code. It is different with id of extension. Whatever thanks for your response again.
cnook