mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 74425: [Search] C/C++ Search missing Enclosing Project scope
Fix for 102926: Turning on index includes in ctags property page does nothing Fix for 102927: Add menu item to force reindex.
This commit is contained in:
parent
aec1c2f69e
commit
54101f2441
13 changed files with 321 additions and 12 deletions
|
@ -1064,13 +1064,14 @@
|
|||
name="CSearchPage"
|
||||
point="org.eclipse.search.searchPages">
|
||||
<page
|
||||
showScopeSection="true"
|
||||
label="%CSearchPage.label"
|
||||
canSearchEnclosingProjects="true"
|
||||
class="org.eclipse.cdt.internal.ui.search.CSearchPage"
|
||||
extensions="c:90,cpp:90, cxx:90, cc:90,C:90, h:90, hh:90, hpp:90, H:90"
|
||||
icon="icons/obj16/csearch_obj.gif"
|
||||
class="org.eclipse.cdt.internal.ui.search.CSearchPage"
|
||||
sizeHint="460, 160"
|
||||
id="org.eclipse.cdt.ui.CSearchPage">
|
||||
id="org.eclipse.cdt.ui.CSearchPage"
|
||||
label="%CSearchPage.label"
|
||||
showScopeSection="true"
|
||||
sizeHint="460, 160">
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.core.model.ITranslationUnit;
|
|||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||
import org.eclipse.cdt.internal.ui.actions.SelectionConverter;
|
||||
import org.eclipse.cdt.internal.ui.editor.OpenIncludeAction;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.AddToIndexAction;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup;
|
||||
import org.eclipse.cdt.ui.actions.CustomFiltersActionGroup;
|
||||
import org.eclipse.cdt.ui.actions.RefactoringActionGroup;
|
||||
|
@ -77,6 +78,8 @@ public class MainActionGroup extends CViewActionGroup {
|
|||
WorkingSetFilterActionGroup workingSetGroup;
|
||||
CustomFiltersActionGroup fCustomFiltersActionGroup;
|
||||
|
||||
AddToIndexAction addToIndexAction;
|
||||
|
||||
SelectionSearchGroup selectionSearchGroup;
|
||||
RefactoringActionGroup refactoringActionGroup;
|
||||
|
||||
|
@ -163,6 +166,7 @@ public class MainActionGroup extends CViewActionGroup {
|
|||
selectionSearchGroup = new SelectionSearchGroup(getCView().getSite());
|
||||
refactoringActionGroup = new RefactoringActionGroup(getCView().getSite(), null);
|
||||
|
||||
addToIndexAction = new AddToIndexAction(getCView().getSite());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -183,6 +187,9 @@ public class MainActionGroup extends CViewActionGroup {
|
|||
menu.add(importAction);
|
||||
exportAction.selectionChanged(resources);
|
||||
menu.add(exportAction);
|
||||
//Can be added once support for manually adding external files to index is established
|
||||
/*menu.add(new Separator());
|
||||
menu.add(addToIndexAction);*/
|
||||
menu.add(new Separator());
|
||||
addSearchMenu(menu, celements);
|
||||
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
|
@ -198,6 +205,8 @@ public class MainActionGroup extends CViewActionGroup {
|
|||
menu.add(new Separator());
|
||||
buildGroup.fillContextMenu(menu);
|
||||
menu.add(new Separator());
|
||||
menu.add(addToIndexAction);
|
||||
menu.add(new Separator());
|
||||
refactorGroup.fillContextMenu(menu);
|
||||
menu.add(new Separator());
|
||||
importAction.selectionChanged(resources);
|
||||
|
|
|
@ -61,12 +61,18 @@ SearchUtil.workingSetConcatenation= {0}, {1}
|
|||
CSearch.FindDeclarationAction.label= &Workspace
|
||||
CSearch.FindDeclarationAction.tooltip= Search for Declarations of the Selected Element in the Workspace
|
||||
|
||||
CSearch.FindDeclarationsProjectAction.label = &Project
|
||||
CSearch.FindDeclarationsProjectAction.tooltip = Search for Declarations of the Selected Element in the current project
|
||||
|
||||
CSearch.FindDeclarationsInWorkingSetAction.label= Working &Set...
|
||||
CSearch.FindDeclarationsInWorkingSetAction.tooltip= Search for Declarations of the Selected Element in a Working Set
|
||||
|
||||
CSearch.FindReferencesAction.label= &Workspace
|
||||
CSearch.FindReferencesAction.tooltip= Search for References to the Selected Element in the Workspace
|
||||
|
||||
CSearch.FindReferencesProjectAction.label= &Project
|
||||
CSearch.FindReferencesProjectAction.tooltip= Search for References to the Selected Element in the current project
|
||||
|
||||
CSearch.FindReferencesInWorkingSetAction.label= Working &Set...
|
||||
CSearch.FindReferencesInWorkingSetAction.tooltip= Search for References to the Selected Element in a Working Set
|
||||
|
||||
|
@ -99,6 +105,7 @@ WorkspaceScope= Workspace
|
|||
WorkingSetScope= Working Set - {0}
|
||||
SelectionScope= Selection
|
||||
HierarchyScope= Hierarchy - {0}
|
||||
ProjectScope = Project
|
||||
|
||||
CElementLabels.concat_string=\ -\
|
||||
CElementLabels.comma_string=,\
|
||||
|
@ -130,3 +137,7 @@ CSearchResultPage.groupby_class.tooltip=Group by Class
|
|||
# Search Page Indexer warnings
|
||||
CSearchPage.warning.indexernoprojects=Index not enabled on any projects
|
||||
CSearchPage.warning.indexersomeprojects=Index not enabled on some projects
|
||||
|
||||
# Add To Index Action
|
||||
ActionDefinition.addToIndex.name= Add To Index
|
||||
ActionDefinition.addToIndex.description= Add file to index
|
|
@ -93,6 +93,14 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
|||
String scopeDescription = ""; //$NON-NLS-1$
|
||||
|
||||
switch( getContainer().getSelectedScope() ) {
|
||||
case ISearchPageContainer.SELECTED_PROJECTS_SCOPE:
|
||||
if( fStructuredSelection != null && fStructuredSelection.iterator().hasNext() ){
|
||||
scopeDescription = CSearchMessages.getString("ProjectScope"); //$NON-NLS-1$
|
||||
scope = CSearchScopeFactory.getInstance().createEnclosingProjectScope(fStructuredSelection);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ISearchPageContainer.SELECTION_SCOPE:
|
||||
if( fStructuredSelection != null && fStructuredSelection.iterator().hasNext() ){
|
||||
scopeDescription = CSearchMessages.getString("SelectionScope"); //$NON-NLS-1$
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Set;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.search.BasicSearchMatch;
|
||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||
import org.eclipse.cdt.core.search.SearchEngine;
|
||||
|
@ -133,6 +134,27 @@ public class CSearchScopeFactory {
|
|||
return createCSearchScope( cElements );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fStructuredSelection
|
||||
* @return
|
||||
*/
|
||||
public ICSearchScope createEnclosingProjectScope(IStructuredSelection fStructuredSelection) {
|
||||
Set cElements = new HashSet( fStructuredSelection.size() );
|
||||
|
||||
Iterator iter = fStructuredSelection.iterator();
|
||||
while( iter.hasNext() ){
|
||||
Object tempObj = iter.next();
|
||||
if ( tempObj instanceof ICElement){
|
||||
ICProject cproject = ((ICElement) tempObj).getCProject();
|
||||
if (cproject != null)
|
||||
cElements.add(cproject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return createCSearchScope( cElements );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param elements
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.index.ICDTIndexer;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
|
||||
public class AddToIndexAction extends Action {
|
||||
|
||||
protected IWorkbenchSite fSite;
|
||||
protected CEditor fEditor;
|
||||
|
||||
|
||||
public AddToIndexAction(CEditor editor, String label, String tooltip){
|
||||
fEditor = editor;
|
||||
setText(label); //$NON-NLS-1$
|
||||
setToolTipText(tooltip); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public AddToIndexAction(CEditor editor){
|
||||
this(editor,
|
||||
CSearchMessages.getString("ActionDefinition.addToIndex.name"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("ActionDefinition.addToIndex.description")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public AddToIndexAction(IWorkbenchSite site){
|
||||
this(site,
|
||||
CSearchMessages.getString("ActionDefinition.addToIndex.name"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("ActionDefinition.addToIndex.description")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public AddToIndexAction(IWorkbenchSite site, String label, String tooltip) {
|
||||
fSite = site;
|
||||
setText(label);
|
||||
setToolTipText(tooltip);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (fEditor != null){
|
||||
ICElement celement= fEditor.getInputCElement();
|
||||
IResource resource = celement.getUnderlyingResource();
|
||||
if (resource != null){
|
||||
IProject project = resource.getProject();
|
||||
if (project != null)
|
||||
CCorePlugin.getDefault().getCoreModel().getIndexManager().addResource(project,resource);
|
||||
}
|
||||
} else if ( fSite != null) {
|
||||
if (fSite.getSelectionProvider() != null ){
|
||||
IStructuredSelection sel = (IStructuredSelection) fSite.getSelectionProvider().getSelection();
|
||||
Iterator iter = sel.iterator();
|
||||
while (iter.hasNext()){
|
||||
Object element = iter.next();
|
||||
if (element instanceof ICElement){
|
||||
ICElement cel = (ICElement) element;
|
||||
IProject proj = cel.getCProject().getProject();
|
||||
IResource resource =cel.getResource();
|
||||
if (proj!= null &&
|
||||
resource != null){
|
||||
CCorePlugin.getDefault().getCoreModel().getIndexManager().addResource(proj,resource);
|
||||
}
|
||||
}
|
||||
//Can be added to deal with external files -> but need indexer addResourceByPath support
|
||||
/*else if (element instanceof ITranslationUnit){
|
||||
ITranslationUnit trans = (ITranslationUnit) element;
|
||||
IProject proj = trans.getCProject().getProject();
|
||||
IPath path=trans.getPath();
|
||||
CCorePlugin.getDefault().getCoreModel().getIndexManager().addResourceByPath(proj,path, ICDTIndexer.COMPILATION_UNIT);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -39,12 +39,14 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
private IWorkbenchSite fSite;
|
||||
|
||||
private FindDeclarationsAction fFindDeclarationsAction;
|
||||
private FindDeclarationsProjectAction fFindDeclarationsProjectAction;
|
||||
private FindDeclarationsInWorkingSetAction fFindDeclarationsInWorkingSetAction;
|
||||
|
||||
private ArrayList actions;
|
||||
|
||||
public DeclarationsSearchGroup(IWorkbenchSite site) {
|
||||
fFindDeclarationsAction= new FindDeclarationsAction(site);
|
||||
fFindDeclarationsProjectAction = new FindDeclarationsProjectAction(site);
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(site,null);
|
||||
fSite = site;
|
||||
}
|
||||
|
@ -59,6 +61,9 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_DECL, fFindDeclarationsAction);
|
||||
}
|
||||
|
||||
fFindDeclarationsProjectAction = new FindDeclarationsProjectAction(editor);
|
||||
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(editor,null);
|
||||
}
|
||||
/*
|
||||
|
@ -83,6 +88,7 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
|
||||
FindAction[] actions = getWorkingSetActions();
|
||||
incomingMenu.add(fFindDeclarationsAction);
|
||||
incomingMenu.add(fFindDeclarationsProjectAction);
|
||||
incomingMenu.add(fFindDeclarationsInWorkingSetAction);
|
||||
|
||||
for (int i=0; i<actions.length; i++){
|
||||
|
@ -136,6 +142,7 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
*/
|
||||
public void dispose() {
|
||||
fFindDeclarationsAction= null;
|
||||
fFindDeclarationsProjectAction=null;
|
||||
fFindDeclarationsInWorkingSetAction= null;
|
||||
super.dispose();
|
||||
}
|
||||
|
|
|
@ -105,12 +105,14 @@ public abstract class FindAction extends SelectionParseAction {
|
|||
if (obj instanceof ISourceReference && fSite.getSelectionProvider() instanceof ProblemTreeViewer) {
|
||||
try {
|
||||
fEditor = ((ProblemTreeViewer)fSite.getSelectionProvider()).getEditor();
|
||||
if (fEditor != null){
|
||||
IDocument doc = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
|
||||
ISourceReference ref = (ISourceReference)obj;
|
||||
|
||||
TextSelection selection = new TextSelection(doc, ref.getSourceRange().getIdStartPos(), ref.getSourceRange().getIdLength());
|
||||
run(selection);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class FindDeclarationsInWorkingSetAction extends FindAction {
|
|||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getLimitTo()
|
||||
*/
|
||||
protected LimitTo getLimitTo() {
|
||||
return ICSearchConstants.DECLARATIONS;
|
||||
return ICSearchConstants.DECLARATIONS_DEFINITIONS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||
import org.eclipse.cdt.core.search.SearchEngine;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants.LimitTo;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchScopeFactory;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
|
||||
public class FindDeclarationsProjectAction extends FindAction {
|
||||
|
||||
public FindDeclarationsProjectAction(CEditor editor, String label, String tooltip){
|
||||
super(editor);
|
||||
setText(label); //$NON-NLS-1$
|
||||
setToolTipText(tooltip); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public FindDeclarationsProjectAction(CEditor editor){
|
||||
this(editor,
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsProjectAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsProjectAction.tooltip")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public FindDeclarationsProjectAction(IWorkbenchSite site){
|
||||
this(site,
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsProjectAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsProjectAction.tooltip")); //$NON-NLS-1$
|
||||
}
|
||||
/**
|
||||
* @param site
|
||||
* @param string
|
||||
* @param string2
|
||||
* @param string3
|
||||
*/
|
||||
public FindDeclarationsProjectAction(IWorkbenchSite site, String label, String tooltip) {
|
||||
super(site);
|
||||
setText(label);
|
||||
setToolTipText(tooltip);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScope(org.eclipse.core.resources.IProject)
|
||||
*/
|
||||
protected ICSearchScope getScope() {
|
||||
|
||||
ICProject proj = null;
|
||||
if (fEditor != null){
|
||||
proj= fEditor.getInputCElement().getCProject();
|
||||
} else if (fSite != null){
|
||||
IStructuredSelection sel = (IStructuredSelection) getSelection();
|
||||
return CSearchScopeFactory.getInstance().createEnclosingProjectScope(sel);
|
||||
}
|
||||
|
||||
ICElement[] element = new ICElement[1];
|
||||
element[0]=proj;
|
||||
return SearchEngine.createCSearchScope(element);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScopeDescription()
|
||||
*/
|
||||
protected String getScopeDescription() {
|
||||
// TODO Auto-generated method stub
|
||||
return CSearchMessages.getString("ProjectScope"); //$NON-NLS-1$
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getLimitTo()
|
||||
*/
|
||||
protected LimitTo getLimitTo() {
|
||||
// TODO Auto-generated method stub
|
||||
return ICSearchConstants.DECLARATIONS_DEFINITIONS;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||
import org.eclipse.cdt.core.search.SearchEngine;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants.LimitTo;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchScopeFactory;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
|
||||
public class FindRefsProjectAction extends FindAction {
|
||||
|
||||
public FindRefsProjectAction(CEditor editor, String label, String tooltip){
|
||||
super(editor);
|
||||
setText(label); //$NON-NLS-1$
|
||||
setToolTipText(tooltip); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public FindRefsProjectAction(CEditor editor){
|
||||
this(editor,
|
||||
CSearchMessages.getString("CSearch.FindReferencesProjectAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindReferencesProjectAction.tooltip")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public FindRefsProjectAction(IWorkbenchSite site){
|
||||
this(site,
|
||||
CSearchMessages.getString("CSearch.FindReferencesProjectAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindReferencesProjectAction.tooltip")); //$NON-NLS-1$
|
||||
}
|
||||
/**
|
||||
* @param site
|
||||
* @param string
|
||||
* @param string2
|
||||
* @param string3
|
||||
*/
|
||||
public FindRefsProjectAction(IWorkbenchSite site, String label, String tooltip) {
|
||||
super(site);
|
||||
setText(label);
|
||||
setToolTipText(tooltip);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScope(org.eclipse.core.resources.IProject)
|
||||
*/
|
||||
protected ICSearchScope getScope() {
|
||||
|
||||
ICProject proj = null;
|
||||
if (fEditor != null){
|
||||
proj= fEditor.getInputCElement().getCProject();
|
||||
} else if (fSite != null){
|
||||
IStructuredSelection sel = (IStructuredSelection) getSelection();
|
||||
return CSearchScopeFactory.getInstance().createEnclosingProjectScope(sel);
|
||||
}
|
||||
|
||||
ICElement[] element = new ICElement[1];
|
||||
element[0]=proj;
|
||||
return SearchEngine.createCSearchScope(element);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScopeDescription()
|
||||
*/
|
||||
protected String getScopeDescription() {
|
||||
return CSearchMessages.getString("ProjectScope"); //$NON-NLS-1$
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getLimitTo()
|
||||
*/
|
||||
protected LimitTo getLimitTo() {
|
||||
return ICSearchConstants.REFERENCES;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -29,6 +29,7 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
|||
public class ReferencesSearchGroup extends ActionGroup {
|
||||
|
||||
private FindRefsAction fFindRefsAction;
|
||||
private FindRefsProjectAction fFindRefsProjectAction;
|
||||
private FindRefsInWorkingSetAction fFindRefsInWorkingSetAction;
|
||||
|
||||
private CEditor fEditor;
|
||||
|
@ -36,6 +37,7 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
|
||||
public ReferencesSearchGroup(IWorkbenchSite site) {
|
||||
fFindRefsAction= new FindRefsAction(site);
|
||||
fFindRefsProjectAction = new FindRefsProjectAction(site);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(site, null);
|
||||
fSite=site;
|
||||
}
|
||||
|
@ -51,6 +53,7 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_REFS, fFindRefsAction);
|
||||
}
|
||||
fFindRefsProjectAction = new FindRefsProjectAction(editor);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(editor, null);
|
||||
}
|
||||
|
||||
|
@ -81,6 +84,7 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
|
||||
FindAction[] actions = getWorkingSetActions();
|
||||
incomingMenu.add(fFindRefsAction);
|
||||
incomingMenu.add(fFindRefsProjectAction);
|
||||
incomingMenu.add(fFindRefsInWorkingSetAction);
|
||||
|
||||
for (int i=0; i<actions.length; i++){
|
||||
|
@ -115,6 +119,7 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
*/
|
||||
public void dispose() {
|
||||
fFindRefsAction= null;
|
||||
fFindRefsProjectAction=null;
|
||||
fFindRefsInWorkingSetAction= null;
|
||||
super.dispose();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.ui.dialogs;
|
|||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICExtensionReference;
|
||||
import org.eclipse.cdt.core.index.ICDTIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.ctagsindexer.CTagsIndexer;
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
||||
|
@ -125,6 +126,9 @@ public class CTagsIndexerBlock extends AbstractIndexerPage {
|
|||
orig = cext[i].getExtensionData("ctagsindexincludes"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(indexIncludeFiles)) {
|
||||
cext[i].setExtensionData("ctagsindexincludes", indexIncludeFiles); //$NON-NLS-1$
|
||||
if (indexIncludeFiles.equals( "true")){ //$NON-NLS-1$
|
||||
CCorePlugin.getDefault().getCoreModel().getIndexManager().addResource(proj,proj);
|
||||
}
|
||||
}
|
||||
orig = cext[i].getExtensionData("ctagslocationtype"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(cTagsLocationType)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue