Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Lazy pattern for CDT project setting changes

Hi James,

My requirements are to update a config file iff the project settings have changed which is then needed as input for an external tool that I call during the project build phase. Wouldn't that interfere with the building process?

If I only use the lazy approach my plug-in might not have loaded and wouldn't know that it has to update the mentioned config file in case the user changed the settings of a CDT project in the meantime.


2010/10/19 James Blackburn <jamesblackburn@xxxxxxxxx>
Hi Henry,

In general CDT has no knowledge about the content of what's changed. We don't store / cache the configuraitons anywhere (unlike the platform for resource deltas).  As a result we wouldn't be able to tell whether and how the .cproject has changed since Eclipse was last run. 

Is it possible for you, on plugin start, to schedule a job to getProjectDescription and do whatever it is you need to do with the Project description from scratch?  Also what happens when you're plugin's lazy and not listening to deltas?


On 19 October 2010 18:38, Henry Mathieu <hen.mathieu@xxxxxxxxx> wrote:

I have the requirement to detect user changes on CDT project settings (e.g., add a new include path) and react on it. I'm aware of the interface ICProjectDescriptionListener and was able to use it and basically it works just fine. My problem is that I have to use the early startup mechanism of Eclipse (org.eclipse.ui.startup extension point) to register myself with addCProjectDescriptionListener and to attach an ICProjectDescriptionListener to the CoreModel. Otherwise I would not get notified about project changes while my plug-in has not been loaded.

The solution works, but it's ugly because it circumvents Eclipse lazy-loading mechanism. I know that ISaveParticipant is a possibility to track changes when a plug-in is not yet loaded through queuing of change events. After the plug-in is loaded it gets a single resource change event with alll changes that have occured during the time it was not active. But as far as I know this only works for resource changes...

My question for you is the following: Is there something similar like this for CDT? I would like to get the project setting changes that occured in the meantime. It doesn't have to be a proper delta, it would be enough for me to know that the user changed something.


cdt-dev mailing list

cdt-dev mailing list

Back to the top