diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexer.java
deleted file mode 100644
index 040d93706cf..00000000000
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- *******************************************************************************/
-
-package org.eclipse.cdt.internal.core.pdom.indexer;
-
-import org.eclipse.cdt.core.dom.IPDOMIndexerTask;
-import org.eclipse.cdt.core.dom.IPDOMManager;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-
-/**
- * The Full indexer does full parsing in order to gather index information.
- * It has good accuracy but is relatively slow.
- *
- * @author Doug Schaefer
- *
- */
-public class PDOMFullIndexer extends AbstractPDOMIndexer {
- public static final String ID = IPDOMManager.ID_FULL_INDEXER;
-
- public String getID() {
- return ID;
- }
-
- public IPDOMIndexerTask createTask(ITranslationUnit[] added,
- ITranslationUnit[] changed, ITranslationUnit[] removed) {
- return new PDOMFullIndexerTask(this, added, changed, removed);
- }
-}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexerTask.java
deleted file mode 100644
index 1c6d3ade5ea..00000000000
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMFullIndexerTask.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- *******************************************************************************/
-
-package org.eclipse.cdt.internal.core.pdom.indexer;
-
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
-import org.eclipse.cdt.internal.core.dom.IIncludeFileResolutionHeuristics;
-import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
-
-
-/**
- * Configures the indexer task as a fast indexer task.
- */
-class PDOMFullIndexerTask extends PDOMIndexerTask {
- public PDOMFullIndexerTask(PDOMFullIndexer indexer, ITranslationUnit[] added,
- ITranslationUnit[] changed, ITranslationUnit[] removed) {
- super(added, changed, removed, indexer, false);
- }
-
- @Override
- protected IncludeFileContentProvider createReaderFactory() {
- return IncludeFileContentProvider.adapt(SavedCodeReaderFactory.getInstance());
- }
-
- @Override
- protected IIncludeFileResolutionHeuristics createIncludeHeuristics() {
- return new ProjectIndexerIncludeResolutionHeuristics(getCProject().getProject(), getInputAdapter());
- }
-}
diff --git a/core/org.eclipse.cdt.core/plugin.xml b/core/org.eclipse.cdt.core/plugin.xml
index fd80f02dffc..f518d674662 100644
--- a/core/org.eclipse.cdt.core/plugin.xml
+++ b/core/org.eclipse.cdt.core/plugin.xml
@@ -479,12 +479,6 @@
point="org.eclipse.cdt.core.CIndexer">
-
-
-
-
-
fIndexerConfigMap;
+ private String fTheOneIndexerID;
private Composite fIndexerPageComposite;
private AbstractIndexerPage fCurrentPage;
private Properties fCurrentProperties;
@@ -85,6 +88,7 @@ public class IndexerBlock extends AbstractCOptionPage {
private Button fUseFixedBuildConfig;
private Combo fBuildConfigComboBox;
private ControlEnableState fEnableState;
+ private Group fBuildConfigGroup;
public IndexerBlock(){
super(INDEXER_LABEL);
@@ -96,9 +100,14 @@ public class IndexerBlock extends AbstractCOptionPage {
* Create a profile page only on request
*/
private static class IndexerConfig implements IPluginContribution {
- private AbstractIndexerPage fPage;
+ private static final String NULL = "null"; //$NON-NLS-1$
+ private AbstractIndexerPage fPage;
private IConfigurationElement fElement;
+ public IndexerConfig(NullIndexerBlock fixed) {
+ fPage= fixed;
+ }
+
public IndexerConfig(IConfigurationElement element) {
fElement= element;
}
@@ -119,14 +128,20 @@ public class IndexerBlock extends AbstractCOptionPage {
}
public String getName() {
+ if (fElement == null)
+ return NULL;
return fElement.getAttribute(ATTRIB_NAME);
}
public String getLocalId() {
+ if (fElement == null)
+ return NULL;
return fElement.getAttribute(ATTRIB_ID);
}
public String getPluginId() {
+ if (fElement == null)
+ return NULL;
return fElement.getContributor().getName();
}
}
@@ -160,17 +175,26 @@ public class IndexerBlock extends AbstractCOptionPage {
gd= (GridData) fPreferenceContent.getLayoutData();
gd.horizontalIndent= 0;
- // add combo to select indexer
- Group group= ControlFactory.createGroup(fPreferenceContent,INDEXER_COMBO_LABEL, 1);
- gd= (GridData) group.getLayoutData();
- gd.grabExcessHorizontalSpace= true;
- fIndexersComboBox = ControlFactory.createSelectCombo(group,"", ""); //$NON-NLS-1$ //$NON-NLS-2$
- fIndexersComboBox.addSelectionListener(new SelectionAdapter() {
+
+ // add option to enable indexer
+ final SelectionAdapter indexerChangeListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
onIndexerChange();
}
- });
+ };
+ fEnableIndexer= ControlFactory.createCheckBox(fPreferenceContent, CUIPlugin.getResourceString("IndexerBlock.enable")); //$NON-NLS-1$
+ fEnableIndexer.addSelectionListener(indexerChangeListener);
+
+ // add combo to select indexer
+ Group group= ControlFactory.createGroup(fPreferenceContent,INDEXER_COMBO_LABEL, 1);
+ gd= (GridData) group.getLayoutData();
+ gd.grabExcessHorizontalSpace= true;
+
+ if (fIndexerConfigMap.size() > 2) {
+ fIndexersComboBox = ControlFactory.createSelectCombo(group,"", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ fIndexersComboBox.addSelectionListener(indexerChangeListener);
+ }
// add composite for pages
fIndexerPageComposite= ControlFactory.createComposite(group, 1);
@@ -178,7 +202,7 @@ public class IndexerBlock extends AbstractCOptionPage {
fIndexerPageComposite.setLayout(new TabFolderLayout());
if (needBuildConfigOptions()) {
- group= ControlFactory.createGroup(composite, DialogsMessages.IndexerStrategyBlock_buildConfigGroup, 1);
+ fBuildConfigGroup= group= ControlFactory.createGroup(composite, DialogsMessages.IndexerStrategyBlock_buildConfigGroup, 1);
gd= (GridData) group.getLayoutData();
gd.grabExcessHorizontalSpace= true;
fUseActiveBuildButton= ControlFactory.createRadioButton(group, DialogsMessages.IndexerStrategyBlock_activeBuildConfig, null, null);
@@ -222,11 +246,30 @@ public class IndexerBlock extends AbstractCOptionPage {
ICProjectDescriptionManager prjDescMgr= CCorePlugin.getDefault().getProjectDescriptionManager();
ICProjectDescriptionWorkspacePreferences prefs= prjDescMgr.getProjectDescriptionWorkspacePreferences(false);
boolean useActive= prefs.getConfigurationRelations() == ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE;
- setUseActiveBuildConfig(useActive);
+ fUseActiveBuildButton.setSelection(useActive);
+ fUseFixedBuildConfig.setSelection(!useActive);
}
+ updateBuildConfigEnablement(scope);
}
}
+ void updateBuildConfigEnablement(int scope) {
+ if (fBuildConfigGroup == null)
+ return;
+
+ if (!fEnableIndexer.getSelection()) {
+ ControlEnableState.disable(fBuildConfigGroup);
+ } else {
+ final boolean notDerived = scope != IndexerPreferences.SCOPE_INSTANCE;
+ final boolean fixed = fUseFixedBuildConfig.getSelection();
+ // independent of scope
+ fBuildConfigComboBox.setEnabled(fixed);
+ fUseActiveBuildButton.setEnabled(notDerived);
+ fUseFixedBuildConfig.setEnabled(notDerived);
+ fBuildConfigGroup.setEnabled(notDerived || fixed);
+ }
+ }
+
protected void setUseActiveBuildConfig(boolean useActive) {
if (fBuildConfigComboBox != null) {
if (useActive) {
@@ -236,6 +279,7 @@ public class IndexerBlock extends AbstractCOptionPage {
fBuildConfigComboBox.setEnabled(false);
}
else {
+ // independent of the scope
fBuildConfigComboBox.setEnabled(true);
}
fUseActiveBuildButton.setSelection(useActive);
@@ -246,20 +290,12 @@ public class IndexerBlock extends AbstractCOptionPage {
private void enablePreferenceContent(boolean enable) {
if (fEnableState != null) {
fEnableState.restore();
- if (fUseActiveBuildButton != null) {
- fUseActiveBuildButton.setEnabled(true);
- fUseFixedBuildConfig.setEnabled(true);
- }
}
if (enable) {
fEnableState= null;
}
else {
fEnableState= ControlEnableState.disable(fPreferenceContent);
- if (fUseActiveBuildButton != null) {
- fUseActiveBuildButton.setEnabled(false);
- fUseFixedBuildConfig.setEnabled(false);
- }
}
}
@@ -284,15 +320,23 @@ public class IndexerBlock extends AbstractCOptionPage {
}
private void initializeIndexerCombo() {
- String[] names= new String[fIndexerConfigMap.size()];
- int j= 0;
- for (IndexerConfig config : fIndexerConfigMap.values()) {
- names[j++]= config.getName();
- }
- @SuppressWarnings("unchecked")
- final Comparator