mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Changed indexChangeNotification to removeIndex
Removed Info button from indexer dialog (Bug 91001)
This commit is contained in:
parent
77f685b9ba
commit
b4a9f10228
5 changed files with 32 additions and 27 deletions
|
@ -129,10 +129,9 @@ public interface ICDTIndexer extends IIndexer {
|
||||||
public IIndex getIndex(IPath path, boolean reuseExistingFile, boolean createIfMissing);
|
public IIndex getIndex(IPath path, boolean reuseExistingFile, boolean createIfMissing);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called the index manager when a project changes its indexer to a new indexer. This can be
|
* Called by the index manager when this indexer is about to be removed from a project.
|
||||||
* used to clean up specific indexer properties.
|
|
||||||
* @param project
|
* @param project
|
||||||
*/
|
*/
|
||||||
public void indexerChangeNotification(IProject project);
|
public void indexerRemoved(IProject project);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,15 +65,15 @@ public class CTagsIndexer extends AbstractCExtension implements ICDTIndexer {
|
||||||
public void addRequest(IProject project, IResourceDelta delta, int kind) {
|
public void addRequest(IProject project, IResourceDelta delta, int kind) {
|
||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
/*
|
|
||||||
case ICDTIndexer.PROJECT:
|
case ICDTIndexer.PROJECT:
|
||||||
this.indexAll(element.getCProject().getProject());
|
this.indexAll(project);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ICDTIndexer.FOLDER:
|
/*case ICDTIndexer.FOLDER:
|
||||||
this.indexSourceFolder(element.getCProject().getProject(),element.getPath(),null);
|
this.indexSourceFolder(element.getCProject().getProject(),element.getPath(),null);
|
||||||
break;
|
break;*/
|
||||||
*/
|
|
||||||
|
|
||||||
case ICDTIndexer.COMPILATION_UNIT:
|
case ICDTIndexer.COMPILATION_UNIT:
|
||||||
IFile file = (IFile) delta.getResource();
|
IFile file = (IFile) delta.getResource();
|
||||||
|
@ -102,22 +102,27 @@ public class CTagsIndexer extends AbstractCExtension implements ICDTIndexer {
|
||||||
* @see org.eclipse.cdt.core.index.ICDTIndexer#removeRequest(org.eclipse.cdt.core.model.ICElement, org.eclipse.core.resources.IResourceDelta)
|
* @see org.eclipse.cdt.core.index.ICDTIndexer#removeRequest(org.eclipse.cdt.core.model.ICElement, org.eclipse.core.resources.IResourceDelta)
|
||||||
*/
|
*/
|
||||||
public void removeRequest(IProject project, IResourceDelta delta, int kind) {
|
public void removeRequest(IProject project, IResourceDelta delta, int kind) {
|
||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
/*
|
case ICDTIndexer.PROJECT :
|
||||||
case ICDTIndexer.PROJECT:
|
IPath fullPath = project.getFullPath();
|
||||||
this.indexAll(element.getCProject().getProject());
|
if( delta.getKind() == IResourceDelta.CHANGED )
|
||||||
break;
|
indexManager.discardJobs(fullPath.segment(0));
|
||||||
|
indexStorage.removeIndexFamily(fullPath);
|
||||||
case ICDTIndexer.FOLDER:
|
// NB: Discarding index jobs belonging to this project was done during PRE_DELETE
|
||||||
this.indexSourceFolder(element.getCProject().getProject(),element.getPath(),null);
|
|
||||||
break;
|
break;
|
||||||
*/
|
// NB: Update of index if project is opened, closed, or its c nature is added or removed
|
||||||
case ICDTIndexer.COMPILATION_UNIT:
|
// is done in updateCurrentDeltaAndIndex
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
/*
|
||||||
|
case ICDTIndexer.FOLDER :
|
||||||
|
this.removeSourceFolderFromIndex(project,project.getFullPath(),null);
|
||||||
|
break;*/
|
||||||
|
|
||||||
|
case ICDTIndexer.COMPILATION_UNIT:
|
||||||
|
IFile file = (IFile) delta.getResource();
|
||||||
|
this.remove(file.getFullPath().toString(), file.getProject().getFullPath());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -361,7 +366,7 @@ public class CTagsIndexer extends AbstractCExtension implements ICDTIndexer {
|
||||||
} catch (CoreException e1) {}
|
} catch (CoreException e1) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void indexerChangeNotification(IProject project) {
|
public void indexerRemoved(IProject project) {
|
||||||
//Remove any existing problem markers
|
//Remove any existing problem markers
|
||||||
try {
|
try {
|
||||||
project.deleteMarkers(ICModelMarker.INDEXER_MARKER, true,IResource.DEPTH_ZERO);
|
project.deleteMarkers(ICModelMarker.INDEXER_MARKER, true,IResource.DEPTH_ZERO);
|
||||||
|
|
|
@ -653,7 +653,7 @@ public class SourceIndexer extends AbstractCExtension implements ICDTIndexer {
|
||||||
this.indexAll(project);
|
this.indexAll(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void indexerChangeNotification(IProject project) {
|
public void indexerRemoved(IProject project) {
|
||||||
//Remove any existing problem markers
|
//Remove any existing problem markers
|
||||||
/*try {
|
/*try {
|
||||||
IMarker[] markers = project.findMarkers(ICModelMarker.INDEXER_MARKER, true, IResource.DEPTH_INFINITE);
|
IMarker[] markers = project.findMarkers(ICModelMarker.INDEXER_MARKER, true, IResource.DEPTH_INFINITE);
|
||||||
|
|
|
@ -341,7 +341,7 @@ public class IndexManager extends JobManager{
|
||||||
//Get rid of the old index file
|
//Get rid of the old index file
|
||||||
ICDTIndexer currentIndexer = getIndexerForProject(project);
|
ICDTIndexer currentIndexer = getIndexerForProject(project);
|
||||||
|
|
||||||
currentIndexer.indexerChangeNotification(project);
|
currentIndexer.indexerRemoved(project);
|
||||||
|
|
||||||
IIndexStorage storage = currentIndexer.getIndexStorage();
|
IIndexStorage storage = currentIndexer.getIndexStorage();
|
||||||
if (storage instanceof CIndexStorage)
|
if (storage instanceof CIndexStorage)
|
||||||
|
|
|
@ -207,9 +207,10 @@ public class IndexerBlock extends AbstractCOptionPage {
|
||||||
setPage();
|
setPage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Add button
|
//Make sure that the combo box takes up two cells
|
||||||
ControlFactory.createPushButton(group,"Info ..."); //$NON-NLS-1$
|
GridData gridData = (GridData) indexersComboBox.getLayoutData();
|
||||||
|
gridData.verticalSpan=2;
|
||||||
|
|
||||||
// fill the combobox and set the initial value
|
// fill the combobox and set the initial value
|
||||||
for (Iterator items = getIndexerPageIdList().iterator(); items.hasNext();) {
|
for (Iterator items = getIndexerPageIdList().iterator(); items.hasNext();) {
|
||||||
String profileId = (String)items.next();
|
String profileId = (String)items.next();
|
||||||
|
|
Loading…
Add table
Reference in a new issue