Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » When to add resource markers?
When to add resource markers? [message #489623] Mon, 05 October 2009 07:48 Go to next message
Christoph Höger is currently offline Christoph Höger
Messages: 40
Registered: July 2009
Member
Hi there,

I have a project model that I want to check for errors as soon as there
are changes. But adding the marker to the IProject leads to a problem:

1. inside the ResourceChangeEvent the workspace is locked and therefore
the markers cannot be created

2. Outside the event handling I can add markers but this causes a new
ResourceChangeEvent (which in turn forces the project check and so on)

So how (and when!) am I supposed to add a marker to a project? Do I need
to make the resource change event handling more fine grained (to not
react on marker creation)?

regards

Christoph
Re: When to add resource markers? [message #489821 is a reply to message #489623] Tue, 06 October 2009 03:16 Go to previous messageGo to next message
Hitesh  is currently offline Hitesh
Messages: 19
Registered: July 2009
Junior Member
You should do this during a build (in a builder) or you can try during IResourceChangeEvent.PRE_BUILD, or you may be able to work around it by using IWorkspace. AVOID_UPDATE.

Hitesh
Re: When to add resource markers? [message #489823 is a reply to message #489821] Tue, 06 October 2009 03:20 Go to previous messageGo to next message
Hitesh  is currently offline Hitesh
Messages: 19
Registered: July 2009
Junior Member
And yes modifications to markers should be batched using WorkpaceJob or IWorkspaceRunnable.
Re: When to add resource markers? [message #489851 is a reply to message #489823] Tue, 06 October 2009 05:06 Go to previous messageGo to next message
Christoph Höger is currently offline Christoph Höger
Messages: 40
Registered: July 2009
Member
Am 06.10.2009 09:20, schrieb Hitesh:
> And yes modifications to markers should be batched using WorkpaceJob or
> IWorkspaceRunnable.

Huh. That is bad. So how would I add markers for things like parse
errors that occured during reconciling? AVOID_UPDATE only batches the
resource change events into one single big one. And I cannot add all
markers after resource changes had happened.
How does jdt handle this?
Re: When to add resource markers? [message #489875 is a reply to message #489851] Tue, 06 October 2009 07:30 Go to previous message
Hitesh  is currently offline Hitesh
Messages: 19
Registered: July 2009
Junior Member
The batching part was just a tip Smile

Did you try creating them during a PRE_BUILD or POST_BUILD event in the listener.

If you are creating markers outside the listener (probably via a job) , normally you would not react to marker change that the job just brought about, otherwise this would imply that you are creating markers based on markers (cycle?) rather than some outside info Smile .


>Do I need
>to make the resource change event handling more fine >grained (to not
>react on marker creation)?
Sounds reasonable.

Or maybe create the markers in your own builder so that you are excluded from participation in the change .

You can ged more info abt mechs here: http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

http://www.eclipse.org/articles/Article-Builders/builders.ht ml

Hope this helps.

Hitesh
Previous Topic:How do I get notified when user closes my perspective?
Next Topic:Export deployable feature for Java Web start
Goto Forum:
  


Current Time: Sat Aug 23 01:32:58 EDT 2014

Powered by FUDForum. Page generated in 0.01851 seconds