ICFolderDescription folderDescription = configurationDescription.getRootFolderDescription();
ICLanguageSetting[] languageSettings = folderDescription.getLanguageSettings();
boolean hasChange = false;
// Add include path to all languages
for (int idx = 0; idx < languageSettings.length; idx++) {
ICLanguageSetting lang = languageSettings[idx];
String LangID = lang.getLanguageId();
if (LangID != null) {
if (LangID.startsWith("org.eclipse.cdt.")) { //$NON-NLS-1$
ICLanguageSettingEntry[] OrgIncludeEntries = lang.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
ICLanguageSettingEntry[] OrgIncludeEntriesFull = lang.getResolvedSettingEntries(ICSettingEntry.INCLUDE_PATH);
int copiedEntry = 0;
for (int curEntry = 0; curEntry < OrgIncludeEntries.length; curEntry++) {
IPath cusPath = ((CIncludePathEntry) OrgIncludeEntriesFull[curEntry]).getFullPath();
if ((ResourcesPlugin.getWorkspace().getRoot().exists(cusPath))
|| (((CIncludePathEntry) OrgIncludeEntries[curEntry]).isBuiltIn())) {
OrgIncludeEntries[copiedEntry++] = OrgIncludeEntries[curEntry];
}
}
if (copiedEntry != OrgIncludeEntries.length) // do not save
// if nothing
// has changed
{
ICLanguageSettingEntry[] IncludeEntries = new ICLanguageSettingEntry[copiedEntry];
System.arraycopy(OrgIncludeEntries, 0, IncludeEntries, 0, copiedEntry);
lang.setSettingEntries(ICSettingEntry.INCLUDE_PATH, IncludeEntries);
hasChange = true;
}
}
}
}