Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » register IResourceChangeListener
register IResourceChangeListener [message #1039704] Fri, 12 April 2013 13:32 Go to next message
Hendrik Eeckhaut is currently offline Hendrik EeckhautFriend
Messages: 26
Registered: July 2009
Junior Member
I have a plugin that implements a custom nature and builder. This plugin has to react on resource changes (for resources in projects with this custom nature). So I create a custom IResourceChangeListener that is registered when my plugin is started.

This works fine when projects are created. But if Eclipse is restarted, I can miss change events because the plugin is not loaded (until a build is triggered).

What is the best way to make sure my plugin is loaded when Eclipse has a project with my custom nature? I'd prefer not to force my plugin to always be loaded, only when there is an open project with my nature.

Thanks,
Hendrik.
Re: register IResourceChangeListener [message #1040820 is a reply to message #1039704] Sun, 14 April 2013 06:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26279
Registered: July 2009
Senior Member
Hendrik,

Comments below.

On 12/04/2013 3:32 PM, Hendrik Eeckhaut wrote:
> I have a plugin that implements a custom nature and builder. This
> plugin has to react on resource changes (for resources in projects
> with this custom nature). So I create a custom IResourceChangeListener
> that is registered when my plugin is started.
>
> This works fine when projects are created. But if Eclipse is
> restarted, I can miss change events because the plugin is not loaded
> (until a build is triggered).
Normally builders are sufficient to maintain state without also needing
a special resource change listener. What is it you need to do before a
build is triggered?
>
> What is the best way to make sure my plugin is loaded when Eclipse has
> a project with my custom nature? I'd prefer not to force my plugin to
> always be loaded, only when there is an open project with my nature.
>
> Thanks,
> Hendrik.
Re: register IResourceChangeListener [message #1041139 is a reply to message #1040820] Sun, 14 April 2013 17:39 Go to previous messageGo to next message
Hendrik Eeckhaut is currently offline Hendrik EeckhautFriend
Messages: 26
Registered: July 2009
Junior Member
Hi Ed,

I need to detect that files are added. I thought IResourceChangeListener was the was the best way to handle this.
But maybe I can do this in the builder too.

Thanks for the suggestion,
Hendrik.
Re: register IResourceChangeListener [message #1041537 is a reply to message #1041139] Mon, 15 April 2013 08:19 Go to previous messageGo to next message
Hendrik Eeckhaut is currently offline Hendrik EeckhautFriend
Messages: 26
Registered: July 2009
Junior Member
Thanks Ed,

an incremental builder is indeed the easier solution.
Re: register IResourceChangeListener [message #1041560 is a reply to message #1041537] Mon, 15 April 2013 08:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26279
Registered: July 2009
Senior Member
Hendrik,

Yes that's exactly what I expected. :-)


On 15/04/2013 10:19 AM, Hendrik Eeckhaut wrote:
> Thanks Ed,
>
> an incremental builder is indeed the easier solution.
Previous Topic:Team project set must include custom project location
Next Topic:Forcing p2 update
Goto Forum:
  


Current Time: Thu Dec 18 14:37:15 GMT 2014

Powered by FUDForum. Page generated in 0.02397 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software