Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java5
-rw-r--r--core/org.eclipse.cdt.core/index/ChangeLog7
-rw-r--r--core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java119
-rw-r--r--core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java8
-rw-r--r--core/org.eclipse.cdt.ui/ChangeLog11
-rw-r--r--core/org.eclipse.cdt.ui/plugin.properties2
-rw-r--r--core/org.eclipse.cdt.ui/plugin.xml15
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java40
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java66
11 files changed, 167 insertions, 115 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java
index 8d0f2f0c391..a7ec906eb48 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java
@@ -7,6 +7,7 @@ package org.eclipse.cdt.make.ui.wizards;
import org.eclipse.cdt.make.internal.ui.MakeProjectOptionBlock;
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
+import org.eclipse.cdt.ui.dialogs.IndexerBlock;
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
@@ -30,7 +31,8 @@ import org.eclipse.core.resources.IProject;
public class MakeProjectWizardOptionPage extends NewCProjectWizardOptionPage {
public class MakeWizardOptionBlock extends MakeProjectOptionBlock {
-
+ IndexerBlock indexBlock;
+
public MakeWizardOptionBlock(ICOptionContainer parent) {
super(parent);
}
@@ -38,6 +40,7 @@ public class MakeProjectWizardOptionPage extends NewCProjectWizardOptionPage {
protected void addTabs() {
addTab(new ReferenceBlock());
super.addTabs();
+ addTab(indexBlock = new IndexerBlock());
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
index a0dd9e58e65..4ed509fd22b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
@@ -13,6 +13,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
+import org.eclipse.cdt.ui.dialogs.IndexerBlock;
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
@@ -22,13 +23,15 @@ import org.eclipse.core.resources.IProject;
public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock {
-
+ IndexerBlock indexBlock;
+
public ManagedWizardOptionBlock(ICOptionContainer parent) {
super(parent);
}
protected void addTabs() {
addTab(new ReferenceBlock());
+ addTab(indexBlock = new IndexerBlock());
}
}
diff --git a/core/org.eclipse.cdt.core/index/ChangeLog b/core/org.eclipse.cdt.core/index/ChangeLog
index b223cf5ad08..65aa245bea0 100644
--- a/core/org.eclipse.cdt.core/index/ChangeLog
+++ b/core/org.eclipse.cdt.core/index/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-07 Bogdan Gheorghe
+ - Added Index Enablement checking
+
+ * index/org/eclipse/cdt/internal/core/index/search/indexing/IndexManager.java
+ * index/org/eclipse/cdt/internal/core/index/search/indexing/IndexRequest.java
+
+
2004-02-13 Bogdan Gheorghe
PR 51232
diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
index 54d1cd19f86..03740405f2b 100644
--- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
+++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
@@ -22,6 +22,8 @@ import java.util.Map;
import java.util.zip.CRC32;
import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.ICLogConstants;
import org.eclipse.cdt.internal.core.CharOperation;
import org.eclipse.cdt.internal.core.index.IIndex;
import org.eclipse.cdt.internal.core.index.impl.Index;
@@ -37,7 +39,11 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
public class IndexManager extends JobManager implements IIndexConstants {
@@ -67,6 +73,16 @@ public class IndexManager extends JobManager implements IIndexConstants {
public static boolean VERBOSE = false;
+ public final static String INDEX_MODEL_ID = CCorePlugin.PLUGIN_ID + ".newindexmodel"; //$NON-NLS-1$
+ public final static String ACTIVATION = "enable"; //$NON-NLS-1$
+ public final static QualifiedName activationKey = new QualifiedName(INDEX_MODEL_ID, ACTIVATION);
+
+ public static final String INDEXER_ENABLED = "indexEnabled"; //$NON-NLS-1$
+ public static final String INDEXER_PROBLEMS_ENABLED = "indexerProblemsEnabled"; //$NON-NLS-1$
+ public static final String CDT_INDEXER = "cdt_indexer"; //$NON-NLS-1$
+ public static final String INDEXER_VALUE = "indexValue"; //$NON-NLS-1$
+
+
public synchronized void aboutToUpdateIndex(IPath path, Integer newIndexState) {
// newIndexState is either UPDATING_STATE or REBUILDING_STATE
// must tag the index as inconsistent, in case we exit before the update job is started
@@ -105,6 +121,16 @@ public class IndexManager extends JobManager implements IIndexConstants {
* Note: the actual operation is performed in background
*/
public void addSource(IFile resource, IPath indexedContainer){
+
+ IProject project = resource.getProject();
+
+ boolean indexEnabled = false;
+ if (project != null)
+ indexEnabled = isIndexEnabled(project);
+ else
+ org.eclipse.cdt.internal.core.model.Util.log(null, "IndexManager addSource: File has no project associated : " + resource.getName(), ICLogConstants.CDT); //$NON-NLS-1$
+
+
if (CCorePlugin.getDefault() == null) return;
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
@@ -115,7 +141,9 @@ public class IndexManager extends JobManager implements IIndexConstants {
}
public void updateDependencies(IResource resource){
- if (CCorePlugin.getDefault() == null) return;
+ if (CCorePlugin.getDefault() == null || !isIndexEnabled( resource.getProject()) )
+ return;
+
UpdateDependency job = new UpdateDependency(resource);
request(job);
@@ -240,18 +268,26 @@ public class IndexManager extends JobManager implements IIndexConstants {
public void indexAll(IProject project) {
if (CCorePlugin.getDefault() == null) return;
- // check if the same request is not already in the queue
- IndexRequest request = new IndexAllProject(project, this);
- for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488)
- if (request.equals(this.awaitingJobs[i])) return;
- this.request(request);
+ //check to see if indexing isEnabled for this project
+ boolean indexEnabled = isIndexEnabled(project);
+
+ if (indexEnabled){
+ // check if the same request is not already in the queue
+ IndexRequest request = new IndexAllProject(project, this);
+ for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488)
+ if (request.equals(this.awaitingJobs[i])) return;
+ this.request(request);
+ }
}
/**
* Index the content of the given source folder.
*/
public void indexSourceFolder(CProject javaProject, IPath sourceFolder, final char[][] exclusionPattern) {
IProject project = javaProject.getProject();
-
+
+ if( !isIndexEnabled( project ) )
+ return;
+
if (this.jobEnd > this.jobStart) {
// check if a job to index the project is not already in the queue
IndexRequest request = new IndexAllProject(project, this);
@@ -308,7 +344,8 @@ public class IndexManager extends JobManager implements IIndexConstants {
IndexRequest request = null;
if (target instanceof IProject) {
IProject p = (IProject) target;
- request = new IndexAllProject(p, this);
+ if( p.exists() && isIndexEnabled( p ) )
+ request = new IndexAllProject(p, this);
}
if (request != null)
@@ -347,7 +384,10 @@ public class IndexManager extends JobManager implements IIndexConstants {
* Note: the actual operation is performed in background
*/
public void remove(String resourceName, IPath indexedContainer){
- request(new RemoveFromIndex(resourceName, indexedContainer, this));
+ IProject project = CCorePlugin.getWorkspace().getRoot().getProject(indexedContainer.toString());
+
+ if( isIndexEnabled( project ) )
+ request(new RemoveFromIndex(resourceName, indexedContainer, this));
}
/**
* Removes the index for a given path.
@@ -390,7 +430,10 @@ public class IndexManager extends JobManager implements IIndexConstants {
*/
public void removeSourceFolderFromIndex(CProject javaProject, IPath sourceFolder, char[][] exclusionPatterns) {
IProject project = javaProject.getProject();
-
+
+ if( !isIndexEnabled( project ) )
+ return;
+
if (this.jobEnd > this.jobStart) {
// check if a job to index the project is not already in the queue
IndexRequest request = new IndexAllProject(project, this);
@@ -573,4 +616,60 @@ public class IndexManager extends JobManager implements IIndexConstants {
JobManager.verbose("-> index state updated to: " + state + " for: "+indexName); //$NON-NLS-1$ //$NON-NLS-2$
}
}
+
+ /**
+ * @param project
+ * @return
+ */
+ public boolean isIndexEnabled(IProject project) {
+ if( project == null || !project.exists() || !project.isOpen() )
+ return false;
+
+ Boolean indexValue = null;
+
+ try {
+ indexValue = (Boolean) project.getSessionProperty(activationKey);
+ } catch (CoreException e) {
+ }
+
+ if (indexValue != null)
+ return indexValue.booleanValue();
+
+ try {
+ //Load value for project
+ indexValue = loadIndexerEnabledFromCDescriptor(project);
+ if (indexValue != null){
+ project.setSessionProperty(IndexManager.activationKey, indexValue);
+ return indexValue.booleanValue();
+ }
+
+// TODO: Indexer Block Place holder for Managed Make - take out
+ indexValue = new Boolean(true);
+ project.setSessionProperty(IndexManager.activationKey, indexValue);
+ return indexValue.booleanValue();
+ } catch (CoreException e1) {
+ }
+
+ return false;
+ }
+
+ private Boolean loadIndexerEnabledFromCDescriptor(IProject project) throws CoreException {
+ // Check if we have the property in the descriptor
+ // We pass false since we do not want to create the descriptor if it does not exists.
+ ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project);
+ Boolean strBool = null;
+ if (descriptor != null) {
+ Node child = descriptor.getProjectData(CDT_INDEXER).getFirstChild();
+
+ while (child != null) {
+ if (child.getNodeName().equals(INDEXER_ENABLED))
+ strBool = Boolean.valueOf(((Element)child).getAttribute(INDEXER_VALUE));
+
+
+ child = child.getNextSibling();
+ }
+ }
+
+ return strBool;
+ }
}
diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java
index 96aab0b526c..90146710281 100644
--- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java
+++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java
@@ -13,9 +13,11 @@ package org.eclipse.cdt.internal.core.search.indexing;
import java.io.IOException;
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.internal.core.index.IIndex;
import org.eclipse.cdt.internal.core.search.processing.IJob;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.cdt.internal.core.index.IIndex;
public abstract class IndexRequest implements IJob {
protected boolean isCancelled = false;
@@ -37,6 +39,10 @@ public abstract class IndexRequest implements IJob {
}
public boolean isReadyToRun() {
+ IProject project = CCorePlugin.getWorkspace().getRoot().getProject(indexPath.segment(0));
+ if ( !project.isAccessible() || !this.manager.isIndexEnabled( project ) )
+ return false;
+
// tag the index as inconsistent
this.manager.aboutToUpdateIndex(indexPath, updatedIndexState());
return true;
diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog
index 1945c77caae..7586e28f856 100644
--- a/core/org.eclipse.cdt.ui/ChangeLog
+++ b/core/org.eclipse.cdt.ui/ChangeLog
@@ -1,3 +1,14 @@
+2004-12-07 Bogdan Gheorghe
+
+ Added Index Enablement block
+
+ * src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java
+ * src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java
+ * src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java
+ * src/org/eclipse/cdt/internal/ui/CUIMessages.properties
+ * plugin.properties
+ * plugin.xml
+
2004-05-31 Alain Magloire
Thomas patch dealing with memory leaks.
diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties
index 98bde042e4a..dea44678067 100644
--- a/core/org.eclipse.cdt.ui/plugin.properties
+++ b/core/org.eclipse.cdt.ui/plugin.properties
@@ -94,3 +94,5 @@ CSearchActionSet.description= Action set containing search related C/C++ actions
# Menus
searchMenu.label= Se&arch
+# Indexer
+CDTIndexerProperty.name=C/C++ Indexer \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index a2bc0c1ce64..4d523436d42 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -27,9 +27,9 @@
<extension-point id="CElementFilters" name="%elementFiltersName"/>
<extension-point id="BinaryParserPage" name="Binary Parser Page"/>
<!-- =========================================================================== -->
-<!-- Extension point: org.eclipse.cdt.ui.textHovers -->
-<!-- Purpose: Provide a perspective specific text hovering for CEditor files -->
<!-- Extension Implementation: must implement org.eclipse.jface.text.ITextHover -->
+<!-- Purpose: Provide a perspective specific text hovering for CEditor files -->
+<!-- Extension point: org.eclipse.cdt.ui.textHovers -->
<!-- =========================================================================== -->
<extension-point id="textHovers" name="%textHoversName"/>
@@ -130,8 +130,8 @@
id="org.eclipse.cdt.ui.CView">
</view>
</extension>
-<!-- For C Wizards -->
<!-- The wizards -->
+<!-- For C Wizards -->
<extension
point="org.eclipse.ui.newWizards">
<category
@@ -483,5 +483,14 @@
id="ElfBinaryParserPage">
</parserPage>
</extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ objectClass="org.eclipse.core.resources.IProject"
+ name="%CDTIndexerProperty.name"
+ class="org.eclipse.cdt.ui.dialogs.IndexerOptionPropertyPage"
+ id="org.eclipse.cdt.ui.indexer">
+ </page>
+ </extension>
</plugin>
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties
index e7ae383959b..573043535ad 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties
@@ -12,3 +12,7 @@
Drag.move.problem.title=Drag and Drop Problem
Drag.move.problem.message={0} is read only. Do you still wish to delete it?
ExceptionDialog.seeErrorLogMessage=See error log for more details.
+
+IndexerOptions.indexer = C/C++ Indexer
+IndexerOptions.enableIndexing = Enable C/C++ &Indexing
+
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java
index ef2afe8d306..ee6d9ecb7ea 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionDialogPage.java
@@ -66,15 +66,6 @@ public class IndexerOptionDialogPage extends DialogPage {
indexerEnabled = createCheckButton(group, ENABLE_INDEXING );
- Group problemsGroup = new Group(result, SWT.NONE );
- problemsGroup.setLayout(new GridLayout());
- problemsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- problemsGroup.setText( INDEXER_PROBLEMS );
-
- preprocessorProblemsEnabled = createCheckButton( problemsGroup, ENABLE_PREPROCESSOR_PROBLEMS );
- semanticProblemsEnabled = createCheckButton( problemsGroup, ENABLE_SEMANTIC_PROBLEMS );
- //uncomment when we want to report syntax problems
- syntacticProblemsEnabled = createCheckButton( problemsGroup, ENABLE_SYNTACTIC_PROBLEMS );
setControl(result);
}
@@ -95,26 +86,11 @@ public class IndexerOptionDialogPage extends DialogPage {
public void setIndexerValue(boolean value){
indexerEnabled.setSelection(value);
}
-
- public void setIndexerProblemValues( int value ){
- preprocessorProblemsEnabled.setSelection( (value & IndexManager.PREPROCESSOR_PROBLEMS_BIT) != 0 );
- if( syntacticProblemsEnabled != null )
- syntacticProblemsEnabled.setSelection( (value & IndexManager.SYNTACTIC_PROBLEMS_BIT) != 0 );
- semanticProblemsEnabled.setSelection( (value & IndexManager.SEMANTIC_PROBLEMS_BIT) != 0 );
- }
-
+
public boolean getIndexerValue(){
return indexerEnabled.getSelection();
}
- public int getIndexerProblemsValues(){
- int result = 0;
- result |= preprocessorProblemsEnabled.getSelection() ? IndexManager.PREPROCESSOR_PROBLEMS_BIT : 0;
- if( syntacticProblemsEnabled != null )
- result |= syntacticProblemsEnabled.getSelection() ? IndexManager.SYNTACTIC_PROBLEMS_BIT : 0;
- result |= semanticProblemsEnabled.getSelection() ? IndexManager.SEMANTIC_PROBLEMS_BIT : 0;
- return result;
- }
public void persistIndexerValues(IProject project){
ICDescriptor descriptor = null;
@@ -123,7 +99,7 @@ public class IndexerOptionDialogPage extends DialogPage {
try {
newProject = project;
- descriptor = CCorePlugin.getDefault().getCProjectDescription(newProject, true);
+ descriptor = CCorePlugin.getDefault().getCProjectDescription(newProject);
rootElement = descriptor.getProjectData(IndexManager.CDT_INDEXER);
// Clear out all current children
@@ -135,17 +111,14 @@ public class IndexerOptionDialogPage extends DialogPage {
Document doc = rootElement.getOwnerDocument();
boolean indexProject = getIndexerValue();
- int problemValues = getIndexerProblemsValues();
saveIndexerEnabled(indexProject, rootElement, doc);
- saveIndexerProblemsEnabled( problemValues, rootElement, doc );
descriptor.saveProjectData();
//Update project session property
project.setSessionProperty(IndexManager.activationKey,new Boolean(indexProject));
- project.setSessionProperty(IndexManager.problemsActivationKey, new Integer( problemValues ));
} catch (CoreException e) {
e.printStackTrace();
@@ -161,12 +134,5 @@ public class IndexerOptionDialogPage extends DialogPage {
rootElement.appendChild(indexEnabled);
}
- private static void saveIndexerProblemsEnabled ( int problemValues, Element rootElement, Document doc ) {
-
- Element enabled = doc.createElement(IndexManager.INDEXER_PROBLEMS_ENABLED);
- Integer tempValue= new Integer( problemValues );
-
- enabled.setAttribute(IndexManager.INDEXER_PROBLEMS_VALUE, tempValue.toString());
- rootElement.appendChild(enabled);
- }
+
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java
index f715051fa98..fabf1d17da8 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/IndexerOptionPropertyPage.java
@@ -14,7 +14,6 @@ package org.eclipse.cdt.ui.dialogs;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICDescriptor;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
-import org.eclipse.cdt.internal.ui.ICHelpContextIds;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.SWT;
@@ -22,7 +21,6 @@ import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -47,7 +45,7 @@ public class IndexerOptionPropertyPage extends PropertyPage {
composite.setLayout(new FillLayout());
optionPage.createControl(composite);
- WorkbenchHelp.setHelp(composite, ICHelpContextIds.PROJECT_INDEXER_PROPERTIES);
+ //WorkbenchHelp.setHelp(composite, ICHelpContextIds.PROJECT_INDEXER_PROPERTIES);
initialize();
return composite;
@@ -64,13 +62,11 @@ public class IndexerOptionPropertyPage extends PropertyPage {
try {
oldIndexerValue = getIndexerEnabled(project);
- oldIndexerProblemsValue = getIndexerProblemsEnabled( project );
} catch (CoreException e) {
e.printStackTrace();
}
optionPage.setIndexerValue(oldIndexerValue);
- optionPage.setIndexerProblemValues( oldIndexerProblemsValue );
}
/*
@@ -79,18 +75,14 @@ public class IndexerOptionPropertyPage extends PropertyPage {
public boolean performOk() {
boolean newIndexerValue = optionPage.getIndexerValue();
- int newIndexerProblemsValue = optionPage.getIndexerProblemsValues();
boolean indexChanged = (oldIndexerValue != newIndexerValue);
- boolean problemsChanged = (oldIndexerProblemsValue != newIndexerProblemsValue );
- if ( indexChanged || problemsChanged){
+ if ( indexChanged ){
//persist new values
IProject tempProject = getProject();
optionPage.persistIndexerValues(tempProject);
- if( problemsChanged && newIndexerProblemsValue == 0)
- CCorePlugin.getDefault().getCoreModel().getIndexManager().removeIndexerProblems(tempProject);
//if indexer is now on send a index all request
if( indexChanged && newIndexerValue && !requestedIndexAll ) {
@@ -137,29 +129,6 @@ public class IndexerOptionPropertyPage extends PropertyPage {
return indexValue.booleanValue();
}
- public int getIndexerProblemsEnabled( IProject project ) throws CoreException
- {
- // See if there's already one associated with the resource for this session
- Integer value = (Integer) project.getSessionProperty( IndexManager.problemsActivationKey );
-
- // Try to load one for the project
- if (value == null) {
- value = loadIndexerProblemsEnabledFromCDescriptor(project);
- }
-
- // There is nothing persisted for the session, or saved in a file so
- // create a build info object
- if (value != null) {
- project.setSessionProperty(IndexManager.problemsActivationKey, value);
- } else {
- //Hmm, no persisted indexer value. Could be an old project - set all to false and persist
- value = new Integer( 0 );
- optionPage.setIndexerProblemValues( 0 );
- optionPage.persistIndexerValues(project);
- }
-
- return value.intValue();
- }
/**
* Loads dis from .cdtproject file
* @param project
@@ -168,7 +137,7 @@ public class IndexerOptionPropertyPage extends PropertyPage {
* @throws CoreException
*/
private Boolean loadIndexerEnabledFromCDescriptor(IProject project) throws CoreException {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project, true);
+ ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project);
Node child = descriptor.getProjectData(IndexManager.CDT_INDEXER).getFirstChild();
Boolean strBool = null;
@@ -184,32 +153,5 @@ public class IndexerOptionPropertyPage extends PropertyPage {
return strBool;
}
- private Integer loadIndexerProblemsEnabledFromCDescriptor( IProject project ) throws CoreException
- {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project, true);
-
- Node child = descriptor.getProjectData(IndexManager.CDT_INDEXER).getFirstChild();
- Integer strInt = null;
-
- while (child != null) {
- if (child.getNodeName().equals(IndexManager.INDEXER_PROBLEMS_ENABLED)) {
- String val = ((Element)child).getAttribute(IndexManager.INDEXER_PROBLEMS_VALUE);
- try{
- strInt = Integer.valueOf( val );
- } catch( NumberFormatException e ){
- //some old projects might have a boolean stored, translate that into just preprocessors
- Boolean bool = Boolean.valueOf( val );
- if( bool.booleanValue() )
- strInt = new Integer( IndexManager.PREPROCESSOR_PROBLEMS_BIT );
- else
- strInt = new Integer( 0 );
- }
- break;
- }
-
- child = child.getNextSibling();
- }
- return strInt;
- }
-}
+} \ No newline at end of file

Back to the top