[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Re: IncrementalProjectBuilder vs. IResourceChangeEvent
|
Ok, what you say sounds perfectly logical but...maybe my design flawed
then...
I use the builder when a new file is created in my project, this is
important cause I need to validate this new file. Everything works fine,
except...I can't manage to update my view correctly.
The event I would use to update my view arrives BEFORE the builder is run
(and the model to show is updated)...so I have no clue how to do this...
Updating the view manually from the builder is both ugly and conceptually
wrong, so how should I do...I found a workaround by "touching" a file to
force another event at the end of my build, that doesn't sound right and you
made me realize I might end up with those endless loops if I am not careful!
So, how I am supposed to update my view :)
Thanks a lot!
"Walter Harley" <wharley@xxxxxxx> wrote in message
news:f3kg5u$hle$1@xxxxxxxxxxxxxxxxxxxx
> "François" <francois.malouin@xxxxxxxxxx> wrote in message
> news:f3k9o2$e0v$1@xxxxxxxxxxxxxxxxxxxx
>> Hello all, just a quick question :)
>>
>> Is there a reason I should use the builders mecanism instead of the plain
>> old event driven way?
>
> Builders are more deterministic: you know when they're going to run. My
> personal rule of thumb now is that resource change listeners are great for
> doing things like updating views, or perhaps reporting errors as in your
> case, but lousy for anything that generates further artifacts. If you
> must use a resource change listener, make sure it's very smart about not
> doing unnecessary work, e.g., don't modify files just to update a
> timestamp.
>
> At my company we've had tremendous headaches with things like endless
> build loops caused when a builder generates a file, that triggers a
> resource change listener, that produces a new file, that triggers a build,
> etc.
>