resource tree locked when creating marker during IElementChangedListener#elementChanged() [message #244766] |
Thu, 21 June 2007 13:15 |
Eclipse User |
|
|
|
Originally posted by: schmidts.iese.fraunhofer.de
Hi
I'm trying to listen for changes in Java code by using an
IElementChangedListener. When I process a delta tree, look for certain
conditions in some Javaelements. In some cases I have to create a Marker
(subtype of ProblemMarker) at a file.
I get an Exception telling me, that the resource tree is locked for
modifications when the method
resource.createMarker(markerType);
is called. The Flag of the ElementChangedEvent ist POST_CHANGE and I read in
the archives of several newsgroups, that my access is not allowed in this
case. But there is no other event that I could use. The description of the
resource lock mechanism refers to the IResourceChangeEvent, but I'm not
using these.
How am I supposed to create a Marker upon an element change, when I only get
a POST_CHANGE event???
Tnx in advance,
Seb
|
|
|
Re: resource tree locked when creating marker during IElementChangedListener#elementChanged() [message #244776 is a reply to message #244766] |
Thu, 21 June 2007 14:32 |
Eclipse User |
|
|
|
Originally posted by: francois.malouin.polymtl.ca
I'm not sure about if this could help you...
But the way Eclipse handles the events and actually creates the markers is
with the concept of builders
(org.eclipse.core.resources.IncrementalProjectBuilder). Multiple builders
can be associated with a project, so you could add yours and get notified
when resources are added/deleted/modifed within that project.
And for a reason I don't really understand, you can add markers while in the
builder, so you could do what you want to do.
Open a .project and you'll see what I am talking about...
buildCommand = registered builders
natures = something you might wanna look into too...they are often used with
builders.
I hope this helps, I too had problems with adding markers :)
Fran
|
|
|
|
Powered by
FUDForum. Page generated in 0.02093 seconds