mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixes for Bugs 64177,57121,68249
This commit is contained in:
parent
d16e76a28e
commit
18c40f7d32
12 changed files with 136 additions and 32 deletions
|
@ -1,3 +1,20 @@
|
|||
2004-07-08 Bogdan Gheorghe
|
||||
Fix for 64177: [Search] Clean up Selection Search UI
|
||||
Fix for 57121: [Search] Searching when all of the "Search For" checkboxes are unchecked causes an exception
|
||||
Fix for 68249: Accessibility: Project Settings Indexer description chopped
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/CPluginResources.properties
|
||||
* src/org/eclipse/cdt/internal/ui/cview/MainActionGroup.java
|
||||
* src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties
|
||||
* src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java
|
||||
* src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefintionIds.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/CSearchPage.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/NewSearchResultCollector.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/SelectionSearchGroup.java
|
||||
* plugin.xml
|
||||
|
||||
2004-07-07 Hoda Amer
|
||||
Fix for PR 69411: Bad label: WizardNewFileCreationPage.progress
|
||||
|
||||
|
|
|
@ -598,6 +598,26 @@
|
|||
category="org.eclipse.cdt.ui.category.source"
|
||||
id="org.eclipse.cdt.ui.edit.opencview">
|
||||
</command>
|
||||
<command
|
||||
description="Find Declaration"
|
||||
category="org.eclipse.cdt.ui.category.source"
|
||||
name="Find Declaration"
|
||||
id="org.eclipse.cdt.ui.search.finddecl"/>
|
||||
<command
|
||||
category="org.eclipse.cdt.ui.category.source"
|
||||
description="Find Refs"
|
||||
name="Find Refs"
|
||||
id="org.eclipse.cdt.ui.search.findrefs"/>
|
||||
<keyBinding
|
||||
command="org.eclipse.cdt.ui.search.findrefs"
|
||||
string="Ctrl+Shift+G"
|
||||
scope="org.eclipse.cdt.ui.cEditorScope"
|
||||
configuration="org.eclipse.ui.defaultAcceleratorConfiguration"/>
|
||||
<keyBinding
|
||||
command="org.eclipse.cdt.ui.search.finddecl"
|
||||
string="Ctrl+G"
|
||||
scope="org.eclipse.cdt.ui.cEditorScope"
|
||||
configuration="org.eclipse.ui.defaultAcceleratorConfiguration"/>
|
||||
</extension>
|
||||
<extension
|
||||
id="org.eclipse.cdt.ui.CSearchPage"
|
||||
|
|
|
@ -44,7 +44,7 @@ BinaryParserBlock.label=Binary Parser
|
|||
BinaryParserBlock.desc=Set required binary parser for this project
|
||||
|
||||
IndexerBlock.label=C/C++ Indexer
|
||||
IndexerBlock.desc=C/C++ Indexer setting for this project. The C/C++ indexer is required for C/C++ search and other related features.
|
||||
IndexerBlock.desc=C/C++ Indexer setting for this project.
|
||||
|
||||
ReferenceBlock.label= Projects
|
||||
ReferenceBlock.desc= Referenced C/C++ Projects
|
||||
|
|
|
@ -43,9 +43,6 @@ ToggleLinkingAction.label=Lin&k With Editor
|
|||
ToggleLinkingAction.toolTip=Link with Editor
|
||||
ToggleLinkingAction.description=Link with active editor
|
||||
|
||||
SearchAction.label=Search For
|
||||
|
||||
|
||||
FilterSelectionAction.label= Filters ...
|
||||
ShowLibrariesAction.label = Show Reference Libs
|
||||
DefaultAction.WIP=WIP
|
||||
|
|
|
@ -252,14 +252,9 @@ public class MainActionGroup extends CViewActionGroup {
|
|||
return;
|
||||
}
|
||||
|
||||
MenuManager search = new MenuManager(CViewMessages.getString("SearchAction.label"), IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
|
||||
|
||||
|
||||
if (SelectionSearchGroup.canActionBeAdded(selection)){
|
||||
selectionSearchGroup.fillContextMenu(search);
|
||||
selectionSearchGroup.fillContextMenu(menu);
|
||||
}
|
||||
|
||||
menu.add(search);
|
||||
}
|
||||
|
||||
public void runDefaultAction(IStructuredSelection selection) {
|
||||
|
|
|
@ -131,9 +131,7 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
|
|||
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$
|
||||
|
||||
if (SelectionSearchGroup.canActionBeAdded(getSelection())){
|
||||
MenuManager search = new MenuManager(CViewMessages.getString("SearchAction.label"), IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
|
||||
fSelectionSearchGroup.fillContextMenu(search);
|
||||
menu.add(search);
|
||||
fSelectionSearchGroup.fillContextMenu(menu);
|
||||
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
}
|
||||
|
||||
|
|
|
@ -79,4 +79,14 @@ public interface ICEditorActionDefinitionIds extends ITextEditorActionDefinition
|
|||
* (value <code>"org.eclipse.cdt.ui.edit.text.redo.action"</code>).
|
||||
*/
|
||||
public static final String REDO_ACTION= "org.eclipse.cdt.ui.edit.text.redo.action"; //$NON-NLS-1$
|
||||
/**
|
||||
* Action definition ID of the find references in workspace action
|
||||
* (value <code>"org.eclipse.cdt.ui.search.findrefs"</code>).
|
||||
*/
|
||||
public static final String FIND_REFS= "org.eclipse.cdt.ui.search.findrefs"; //$NON-NLS-1$
|
||||
/**
|
||||
* Action definition ID of the find declarations in workspace action
|
||||
* (value <code>"org.eclipse.cdt.ui.search.finddecl"</code>).
|
||||
*/
|
||||
public static final String FIND_DECL= "org.eclipse.cdt.ui.search.finddecl"; //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
|||
fCElement= null;
|
||||
handleAllElements( event );
|
||||
List searchFor = getSearchFor();
|
||||
getContainer().setPerformActionEnabled( searchFor.size() != 0 );
|
||||
getContainer().setPerformActionEnabled( searchFor.size() != 0 && getPattern().length() > 0 );
|
||||
setLimitTo( searchFor );
|
||||
updateCaseSensitiveCheckbox();
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
|||
|
||||
fPattern.addModifyListener( new ModifyListener() {
|
||||
public void modifyText( ModifyEvent e ) {
|
||||
getContainer().setPerformActionEnabled( getPattern().length() > 0 );
|
||||
getContainer().setPerformActionEnabled( getPattern().length() > 0 && getSearchFor().size() != 0 );
|
||||
updateCaseSensitiveCheckbox();
|
||||
}
|
||||
});
|
||||
|
@ -426,7 +426,7 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
|||
initSelections();
|
||||
}
|
||||
fPattern.setFocus();
|
||||
getContainer().setPerformActionEnabled(fPattern.getText().length() > 0);
|
||||
getContainer().setPerformActionEnabled(fPattern.getText().length() > 0 && getSearchFor().size() != 0 );
|
||||
}
|
||||
super.setVisible(visible);
|
||||
}
|
||||
|
|
|
@ -126,7 +126,8 @@ public class NewSearchResultCollector extends BasicSearchResultCollector {
|
|||
fMatchCount++;
|
||||
int start = match.getStartOffset();
|
||||
int end = match.getEndOffset();
|
||||
fSearch.addMatch(new Match(match,start,end-start));
|
||||
String classifier = PARENT + match.getParentName() + NAME + match.getName() + LOCATION + match.getLocation().toOSString() + ELEMENTTYPE + match.getElementType() + VISIBILITY + match.getVisibility();
|
||||
fSearch.addMatch(new CSearchMatch(classifier,start,end-start, match));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,17 +11,27 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.search.ui.IContextMenuConstants;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
||||
|
||||
|
||||
public class DeclarationsSearchGroup extends ActionGroup {
|
||||
|
||||
private CEditor fEditor;
|
||||
|
||||
private FindDeclarationsAction fFindDeclarationsAction;
|
||||
private FindDeclarationsInWorkingSetAction fFindDeclarationsInWorkingSetAction;
|
||||
|
||||
|
@ -33,7 +43,13 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
* @param editor
|
||||
*/
|
||||
public DeclarationsSearchGroup(CEditor editor) {
|
||||
fEditor = editor;
|
||||
|
||||
fFindDeclarationsAction= new FindDeclarationsAction(editor);
|
||||
fFindDeclarationsAction.setActionDefinitionId(ICEditorActionDefinitionIds.FIND_DECL);
|
||||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_DECL, fFindDeclarationsAction);
|
||||
}
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(editor);
|
||||
}
|
||||
/*
|
||||
|
@ -43,12 +59,47 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
super.fillContextMenu(menu);
|
||||
|
||||
IMenuManager incomingMenu = menu;
|
||||
|
||||
|
||||
IMenuManager declarationsMenu = new MenuManager(CSearchMessages.getString("group.declarations"), IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
|
||||
|
||||
if (fEditor != null){
|
||||
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, declarationsMenu);
|
||||
}
|
||||
|
||||
incomingMenu.add(declarationsMenu);
|
||||
incomingMenu = declarationsMenu;
|
||||
|
||||
incomingMenu.add(fFindDeclarationsAction);
|
||||
incomingMenu.add(fFindDeclarationsInWorkingSetAction);
|
||||
}
|
||||
|
||||
public static boolean canActionBeAdded(ISelection selection) {
|
||||
if(selection instanceof ITextSelection) {
|
||||
return (((ITextSelection)selection).getLength() > 0);
|
||||
} else {
|
||||
return getElement(selection) != null;
|
||||
}
|
||||
}
|
||||
|
||||
private static ICElement getElement(ISelection sel) {
|
||||
if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
List list= ((IStructuredSelection)sel).toList();
|
||||
if (list.size() == 1) {
|
||||
Object element= list.get(0);
|
||||
if (element instanceof ICElement) {
|
||||
return (ICElement)element;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Overrides method declared in ActionGroup
|
||||
*/
|
||||
public void dispose() {
|
||||
fFindDeclarationsAction= null;
|
||||
fFindDeclarationsInWorkingSetAction= null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,27 +11,39 @@
|
|||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.search.ui.IContextMenuConstants;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
||||
|
||||
public class ReferencesSearchGroup extends ActionGroup {
|
||||
|
||||
private FindRefsAction fFindRefsAction;
|
||||
private FindRefsInWorkingSetAction fFindRefsInWorkingSetAction;
|
||||
|
||||
private CEditor fEditor;
|
||||
private IWorkbenchSite fSite;
|
||||
|
||||
public ReferencesSearchGroup(IWorkbenchSite site) {
|
||||
fFindRefsAction= new FindRefsAction(site);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(site);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param editor
|
||||
*/
|
||||
public ReferencesSearchGroup(CEditor editor) {
|
||||
fEditor = editor;
|
||||
|
||||
fFindRefsAction= new FindRefsAction(editor);
|
||||
fFindRefsAction.setActionDefinitionId(ICEditorActionDefinitionIds.FIND_REFS);
|
||||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_REFS, fFindRefsAction);
|
||||
}
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(editor);
|
||||
}
|
||||
|
||||
|
@ -45,6 +57,11 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
IMenuManager incomingMenu = menu;
|
||||
|
||||
IMenuManager refsMenu = new MenuManager(CSearchMessages.getString("group.references"), IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
|
||||
|
||||
if (fEditor != null){
|
||||
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, refsMenu);
|
||||
}
|
||||
|
||||
incomingMenu.add(refsMenu);
|
||||
incomingMenu = refsMenu;
|
||||
|
||||
|
@ -52,4 +69,13 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
incomingMenu.add(fFindRefsInWorkingSetAction);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Overrides method declared in ActionGroup
|
||||
*/
|
||||
public void dispose() {
|
||||
fFindRefsAction= null;
|
||||
fFindRefsInWorkingSetAction= null;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,19 +11,16 @@
|
|||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.search.CSearchMessages;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.search.ui.IContextMenuConstants;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
import org.eclipse.ui.part.Page;
|
||||
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
||||
|
||||
public class SelectionSearchGroup extends ActionGroup {
|
||||
|
||||
|
@ -58,16 +55,8 @@ public class SelectionSearchGroup extends ActionGroup {
|
|||
public void fillContextMenu(IMenuManager menu) {
|
||||
super.fillContextMenu(menu);
|
||||
|
||||
IMenuManager incomingMenu = menu;
|
||||
|
||||
if (fEditor != null){
|
||||
IMenuManager selSearchMenu = new MenuManager(CSearchMessages.getString("group.search"), IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$
|
||||
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, selSearchMenu);
|
||||
incomingMenu = selSearchMenu;
|
||||
}
|
||||
|
||||
fDeclarationsSearchGroup.fillContextMenu(incomingMenu);
|
||||
fRefSearchGroup.fillContextMenu(incomingMenu);
|
||||
fDeclarationsSearchGroup.fillContextMenu(menu);
|
||||
fRefSearchGroup.fillContextMenu(menu);
|
||||
}
|
||||
|
||||
public static boolean canActionBeAdded(ISelection selection) {
|
||||
|
|
Loading…
Add table
Reference in a new issue