views:

14

answers:

0

Hi Everyone!

My Resource(XML file)'s listener has two type of events as following.

IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_BUILD

When POST_CHANGE occurs, My plugin will parse the Resource(XML file). And when PRE_BUILD occurs, My plugin will add Problem Mark as following

IMarker marker = file.createMarker(PROBLEM_ID); marker.setAttribute(IMarker.SEVERITY,IMarker.SEVERITY_ERROR); marker.setAttribute(IMarker.MESSAGE, "Check XML"); marker.setAttribute(IMarker.CHAR_START, 1900); marker.setAttribute(IMarker.CHAR_END, 2000); marker.setAttribute(IMarker.LINE_NUMBER, 6);

The problem is this.. After add the Problem Mark, POST_CHANGE event occurs again. So the Parsing operation occurs. But it is not necessary work.

The Marker is not added real file. It is added in the meta data of file. Even though it is a change of meta data, the POST_CHANGE event occurs.

How can I solve this problem? What I guessed solution is this..

  1. Use time stamp of Resource(XML file).
  2. If I distinguish 'Meta data change' from 'File change' then use this.

Please let me know what is the best solution.

Thanks a lot for your response.