Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT project view: How to programatically update the directories shown below 'Includes'?

Am Donnerstag, 23. November 2017, 22:29:57 CET schrieb Jonah Graham:

> Sorry Martin, I got distracted with something else after not finding the

Hi Jonah,
thanks for your thorough investigation.

> The Content Provider providing Includes to the Common Navigator
> is: org.eclipse.cdt.internal.ui.navigator.CNavigatorContentProvider
> (extending the org.eclipse.ui.navigator.navigatorContent extension point).
> IncludeRefContainer provides the view model object for the "Includes" node.
> You can refresh the data by calling refresh() on the viewer passing the
> project as the element to refresh.

Could you explain how to retrieve that viewer? I tried to retrieve it via
PlatformUI.getWorkbench(), but no luck. (I'm not too familiar with JFace, I 
admit)

> The refresh is kicked off by
> 
LanguageSettingsProvidersSerializer.notifyLanguageSettingsChangeListeners(IL
> anguageSettingsChangeEvent) which is kicked off by the below methods.

This finally ends in a single listener, 
org.eclipse.cdt.internal.core.pdom.LanguageSettingsChangeListener and calls 
PDOMManager#update(). This seems to trigger re-indexing and updates the 
display of open editor views, which is fine.

...
> You should be able to call this:
> 
LanguageSettingsSerializableProvider.serializeLanguageSettingsInBackground(I
> CConfigurationDescription) or the foreground version
> serializeLanguageSettings.
Yes, this updates the #if sections in the C-editor views.

Martin

-- 
E-Mails sollten Text sein, Text und nur Text.
Wenn Gott gewollt hätte, dass E-Mails in HTML geschrieben würden,
endeten Gebete traditionell mit </amen>.


Back to the top