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 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?

Cheers,
James

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

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.

Thanks,
Henry

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top