mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Fix for Bug 72816: Selection Search For Working Set does not always bring up dialog
This commit is contained in:
parent
b3e82309c9
commit
9e0823e2e8
8 changed files with 288 additions and 21 deletions
|
@ -1,3 +1,15 @@
|
|||
2004-09-02 Bogdan Gheorghe
|
||||
Fix for 72816: [Search] Selection Search For Working Set
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/LRUWorkingSets.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/DeclarationsSearchGroup.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/FindDeclarationsInWorkingSetAction.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/FindRefsInWorkingSetAction.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java
|
||||
* src/org/eclipse/cdt/internal/ui/search/actions/WorkingSetFindAction.java
|
||||
|
||||
|
||||
2004-09-01 Alain Magloire
|
||||
|
||||
Deal with the fact that elements can come
|
||||
|
|
|
@ -39,6 +39,9 @@ import org.eclipse.ui.IWorkingSet;
|
|||
*/
|
||||
public class CSearchUtil {
|
||||
|
||||
public static int LRU_WORKINGSET_LIST_SIZE= 3;
|
||||
private static LRUWorkingSets workingSetsCache;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -50,11 +53,20 @@ public class CSearchUtil {
|
|||
/**
|
||||
* @param sets
|
||||
*/
|
||||
public static void updateLRUWorkingSets(IWorkingSet[] sets) {
|
||||
// TODO Auto-generated method stub
|
||||
public static void updateLRUWorkingSets(IWorkingSet[] workingSets) {
|
||||
if (workingSets == null || workingSets.length < 1)
|
||||
return;
|
||||
|
||||
CSearchUtil.getLRUWorkingSets().add(workingSets);
|
||||
}
|
||||
|
||||
public static LRUWorkingSets getLRUWorkingSets() {
|
||||
if (CSearchUtil.workingSetsCache == null) {
|
||||
CSearchUtil.workingSetsCache = new LRUWorkingSets(CSearchUtil.LRU_WORKINGSET_LIST_SIZE);
|
||||
}
|
||||
return CSearchUtil.workingSetsCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @param shell
|
||||
|
@ -63,12 +75,11 @@ public class CSearchUtil {
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param workingSets
|
||||
* @return
|
||||
*/
|
||||
public static Object toString(IWorkingSet[] workingSets) {
|
||||
public static String toString(IWorkingSet[] workingSets) {
|
||||
if( workingSets != null & workingSets.length > 0 ){
|
||||
String string = new String();
|
||||
for( int i = 0; i < workingSets.length; i++ ){
|
||||
|
@ -83,6 +94,7 @@ public class CSearchUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param marker
|
||||
* @return
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* Created on Aug 30, 2004
|
||||
*
|
||||
* TODO To change the template for this generated file go to
|
||||
* Window - Preferences - Java - Code Style - Code Templates
|
||||
*/
|
||||
package org.eclipse.cdt.internal.ui.search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.ui.IWorkingSet;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author bgheorgh
|
||||
*
|
||||
* TODO To change the template for this generated type comment go to
|
||||
* Window - Preferences - Java - Code Style - Code Templates
|
||||
*/
|
||||
public class LRUWorkingSets {
|
||||
|
||||
ArrayList workingSetsCache = null;
|
||||
int size=0;
|
||||
|
||||
public LRUWorkingSets(int size){
|
||||
workingSetsCache = new ArrayList(size);
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public void add(IWorkingSet[] workingSet){
|
||||
cleanUpCache();
|
||||
//See if this working set has been previously added to the
|
||||
IWorkingSet[] existingWorkingSets= find(workingSetsCache, workingSet);
|
||||
if (existingWorkingSets != null)
|
||||
workingSetsCache.remove(existingWorkingSets);
|
||||
else if (workingSetsCache.size() == size)
|
||||
workingSetsCache.remove(size - 1);
|
||||
workingSetsCache.add(0, workingSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param workingSetsCache2
|
||||
* @param workingSet
|
||||
* @return
|
||||
*/
|
||||
private IWorkingSet[] find(ArrayList list, IWorkingSet[] workingSet) {
|
||||
Set workingSetList= new HashSet(Arrays.asList(workingSet));
|
||||
Iterator iter= list.iterator();
|
||||
while (iter.hasNext()) {
|
||||
IWorkingSet[] lruWorkingSets= (IWorkingSet[])iter.next();
|
||||
Set lruWorkingSetList= new HashSet(Arrays.asList(lruWorkingSets));
|
||||
if (lruWorkingSetList.equals(workingSetList))
|
||||
return lruWorkingSets;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void cleanUpCache(){
|
||||
//Remove any previously deleted entries
|
||||
Iterator iter = workingSetsCache.iterator();
|
||||
while (iter.hasNext()){
|
||||
IWorkingSet[] workingSet = (IWorkingSet []) iter.next();
|
||||
for (int i= 0; i < workingSet.length; i++) {
|
||||
if (PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(workingSet[i].getName()) == null) {
|
||||
workingSetsCache.remove(workingSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public Iterator iterator() {
|
||||
return workingSetsCache.iterator();
|
||||
}
|
||||
}
|
|
@ -11,12 +11,15 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
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.cdt.internal.ui.search.CSearchUtil;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
|
@ -24,6 +27,7 @@ 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.IWorkingSet;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
||||
|
||||
|
@ -31,13 +35,17 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
|||
public class DeclarationsSearchGroup extends ActionGroup {
|
||||
|
||||
private CEditor fEditor;
|
||||
private IWorkbenchSite fSite;
|
||||
|
||||
private FindDeclarationsAction fFindDeclarationsAction;
|
||||
private FindDeclarationsInWorkingSetAction fFindDeclarationsInWorkingSetAction;
|
||||
|
||||
private ArrayList actions;
|
||||
|
||||
public DeclarationsSearchGroup(IWorkbenchSite site) {
|
||||
fFindDeclarationsAction= new FindDeclarationsAction(site);
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(site);
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(site,null);
|
||||
fSite = site;
|
||||
}
|
||||
/**
|
||||
* @param editor
|
||||
|
@ -50,7 +58,7 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_DECL, fFindDeclarationsAction);
|
||||
}
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(editor);
|
||||
fFindDeclarationsInWorkingSetAction = new FindDeclarationsInWorkingSetAction(editor,null);
|
||||
}
|
||||
/*
|
||||
* Method declared on ActionGroup.
|
||||
|
@ -69,10 +77,35 @@ public class DeclarationsSearchGroup extends ActionGroup {
|
|||
incomingMenu.add(declarationsMenu);
|
||||
incomingMenu = declarationsMenu;
|
||||
|
||||
FindAction[] actions = getWorkingSetActions();
|
||||
incomingMenu.add(fFindDeclarationsAction);
|
||||
incomingMenu.add(fFindDeclarationsInWorkingSetAction);
|
||||
|
||||
for (int i=0; i<actions.length; i++){
|
||||
incomingMenu.add(actions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private FindAction[] getWorkingSetActions() {
|
||||
ArrayList actions= new ArrayList(CSearchUtil.LRU_WORKINGSET_LIST_SIZE);
|
||||
|
||||
Iterator iter= CSearchUtil.getLRUWorkingSets().iterator();
|
||||
while (iter.hasNext()) {
|
||||
IWorkingSet[] workingSets= (IWorkingSet[])iter.next();
|
||||
FindAction action;
|
||||
if (fEditor != null)
|
||||
action= new WorkingSetFindAction(fEditor, new FindDeclarationsInWorkingSetAction(fEditor, workingSets), CSearchUtil.toString(workingSets));
|
||||
else
|
||||
action= new WorkingSetFindAction(fSite, new FindDeclarationsInWorkingSetAction(fSite, workingSets), CSearchUtil.toString(workingSets));
|
||||
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
return (FindAction[])actions.toArray(new FindAction[actions.size()]);
|
||||
}
|
||||
public static boolean canActionBeAdded(ISelection selection) {
|
||||
if(selection instanceof ITextSelection) {
|
||||
return (((ITextSelection)selection).getLength() > 0);
|
||||
|
|
|
@ -23,23 +23,29 @@ import org.eclipse.ui.IWorkingSet;
|
|||
public class FindDeclarationsInWorkingSetAction extends FindAction {
|
||||
|
||||
private IWorkingSet[] fWorkingSet;
|
||||
|
||||
private String scopeDescription = "";
|
||||
/**
|
||||
* @param site
|
||||
*/
|
||||
public FindDeclarationsInWorkingSetAction(IWorkbenchSite site) {
|
||||
public FindDeclarationsInWorkingSetAction(IWorkbenchSite site, IWorkingSet[] wset) {
|
||||
this(site,
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsInWorkingSetAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsInWorkingSetAction.tooltip")); //$NON-NLS-1$
|
||||
|
||||
if (wset != null)
|
||||
fWorkingSet = wset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param editor
|
||||
*/
|
||||
public FindDeclarationsInWorkingSetAction(CEditor editor) {
|
||||
public FindDeclarationsInWorkingSetAction(CEditor editor, IWorkingSet[] wset) {
|
||||
this(editor,
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsInWorkingSetAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindDeclarationsInWorkingSetAction.tooltip")); //$NON-NLS-1$
|
||||
|
||||
if (wset != null)
|
||||
fWorkingSet = wset;
|
||||
}
|
||||
|
||||
public FindDeclarationsInWorkingSetAction(CEditor editor, String label, String tooltip){
|
||||
|
@ -62,21 +68,23 @@ public class FindDeclarationsInWorkingSetAction extends FindAction {
|
|||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScopeDescription()
|
||||
*/
|
||||
protected String getScopeDescription() {
|
||||
return CSearchMessages.getFormattedString("WorkingSetScope", CSearchUtil.toString(fWorkingSet)); //$NON-NLS-1$
|
||||
return scopeDescription;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScope()
|
||||
*/
|
||||
protected ICSearchScope getScope() {
|
||||
//
|
||||
IWorkingSet[] workingSets= fWorkingSet;
|
||||
IWorkingSet[] workingSets= null;
|
||||
if (fWorkingSet == null) {
|
||||
workingSets= CSearchScopeFactory.getInstance().queryWorkingSets();
|
||||
if (workingSets == null)
|
||||
return null;
|
||||
fWorkingSet = workingSets;
|
||||
}
|
||||
else {
|
||||
workingSets = fWorkingSet;
|
||||
}
|
||||
ICSearchScope scope= CSearchScopeFactory.getInstance().createCSearchScope(workingSets);
|
||||
scopeDescription = CSearchMessages.getFormattedString("WorkingSetScope", new String[] {CSearchUtil.toString(workingSets)}); //$NON-NLS-1$
|
||||
CSearchUtil.updateLRUWorkingSets(workingSets);
|
||||
|
||||
return scope;
|
||||
|
|
|
@ -22,16 +22,25 @@ import org.eclipse.ui.IWorkingSet;
|
|||
|
||||
public class FindRefsInWorkingSetAction extends FindAction {
|
||||
|
||||
public FindRefsInWorkingSetAction(CEditor editor) {
|
||||
private IWorkingSet[] fWorkingSet;
|
||||
private String scopeDescription = "";
|
||||
|
||||
public FindRefsInWorkingSetAction(CEditor editor, IWorkingSet[] workingSets) {
|
||||
this(editor,
|
||||
CSearchMessages.getString("CSearch.FindReferencesInWorkingSetAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindReferencesInWorkingSetAction.tooltip")); //$NON-NLS-1$
|
||||
|
||||
if (workingSets != null)
|
||||
fWorkingSet = workingSets;
|
||||
}
|
||||
|
||||
public FindRefsInWorkingSetAction(IWorkbenchSite site){
|
||||
public FindRefsInWorkingSetAction(IWorkbenchSite site, IWorkingSet[] workingSets){
|
||||
this(site,
|
||||
CSearchMessages.getString("CSearch.FindReferencesInWorkingSetAction.label"), //$NON-NLS-1$
|
||||
CSearchMessages.getString("CSearch.FindReferencesInWorkingSetAction.tooltip")); //$NON-NLS-1$
|
||||
|
||||
if (workingSets != null)
|
||||
fWorkingSet= workingSets;
|
||||
}
|
||||
/**
|
||||
* @param editor
|
||||
|
@ -65,24 +74,27 @@ public class FindRefsInWorkingSetAction extends FindAction {
|
|||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScopeDescription()
|
||||
*/
|
||||
protected String getScopeDescription() {
|
||||
return CSearchMessages.getFormattedString("WorkingSetScope", CSearchUtil.toString(fWorkingSet)); //$NON-NLS-1$
|
||||
return scopeDescription;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.editor.selsearch.FindAction#getScope()
|
||||
*/
|
||||
protected ICSearchScope getScope() {
|
||||
IWorkingSet[] workingSets= fWorkingSet;
|
||||
IWorkingSet[] workingSets= null;
|
||||
if (fWorkingSet == null) {
|
||||
workingSets= CSearchScopeFactory.getInstance().queryWorkingSets();
|
||||
if (workingSets == null)
|
||||
return null;
|
||||
fWorkingSet = workingSets;
|
||||
}
|
||||
else {
|
||||
workingSets = fWorkingSet;
|
||||
}
|
||||
|
||||
ICSearchScope scope= CSearchScopeFactory.getInstance().createCSearchScope(workingSets);
|
||||
scopeDescription = CSearchMessages.getFormattedString("WorkingSetScope", new String[] {CSearchUtil.toString(workingSets)}); //$NON-NLS-1$
|
||||
CSearchUtil.updateLRUWorkingSets(workingSets);
|
||||
|
||||
return scope;
|
||||
}
|
||||
|
||||
private IWorkingSet[] fWorkingSet;
|
||||
}
|
||||
|
|
|
@ -10,13 +10,18 @@
|
|||
******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
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.cdt.internal.ui.search.CSearchUtil;
|
||||
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.IWorkingSet;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
|
||||
|
||||
|
@ -28,9 +33,12 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
private CEditor fEditor;
|
||||
private IWorkbenchSite fSite;
|
||||
|
||||
private ArrayList actions;
|
||||
|
||||
public ReferencesSearchGroup(IWorkbenchSite site) {
|
||||
fFindRefsAction= new FindRefsAction(site);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(site);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(site, null);
|
||||
fSite=site;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,7 +52,7 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
if (editor != null){
|
||||
editor.setAction(ICEditorActionDefinitionIds.FIND_REFS, fFindRefsAction);
|
||||
}
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(editor);
|
||||
fFindRefsInWorkingSetAction = new FindRefsInWorkingSetAction(editor, null);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -65,11 +73,37 @@ public class ReferencesSearchGroup extends ActionGroup {
|
|||
incomingMenu.add(refsMenu);
|
||||
incomingMenu = refsMenu;
|
||||
|
||||
FindAction[] actions = getWorkingSetActions();
|
||||
incomingMenu.add(fFindRefsAction);
|
||||
incomingMenu.add(fFindRefsInWorkingSetAction);
|
||||
|
||||
for (int i=0; i<actions.length; i++){
|
||||
incomingMenu.add(actions[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private FindAction[] getWorkingSetActions() {
|
||||
ArrayList actions= new ArrayList(CSearchUtil.LRU_WORKINGSET_LIST_SIZE);
|
||||
|
||||
Iterator iter= CSearchUtil.getLRUWorkingSets().iterator();
|
||||
while (iter.hasNext()) {
|
||||
IWorkingSet[] workingSets= (IWorkingSet[])iter.next();
|
||||
FindAction action;
|
||||
if (fEditor != null)
|
||||
action= new WorkingSetFindAction(fEditor, new FindRefsInWorkingSetAction(fEditor, workingSets), CSearchUtil.toString(workingSets));
|
||||
else
|
||||
action= new WorkingSetFindAction(fSite, new FindRefsInWorkingSetAction(fSite, workingSets), CSearchUtil.toString(workingSets));
|
||||
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
return (FindAction[])actions.toArray(new FindAction[actions.size()]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Overrides method declared in ActionGroup
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Created on Aug 31, 2004
|
||||
*
|
||||
* TODO To change the template for this generated file go to
|
||||
* Window - Preferences - Java - Code Style - Code Templates
|
||||
*/
|
||||
package org.eclipse.cdt.internal.ui.search.actions;
|
||||
|
||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants.LimitTo;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IWorkbenchSite;
|
||||
|
||||
public class WorkingSetFindAction extends FindAction {
|
||||
|
||||
private FindAction findAction;
|
||||
|
||||
public WorkingSetFindAction(CEditor editor, FindAction action, String string) {
|
||||
super ( editor );
|
||||
this.findAction = action;
|
||||
setText(string); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* @param site
|
||||
* @param action
|
||||
* @param string
|
||||
*/
|
||||
public WorkingSetFindAction(IWorkbenchSite site,FindAction action, String string) {
|
||||
super(site);
|
||||
this.findAction = action;
|
||||
setText(string); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.search.actions.FindAction#getScopeDescription()
|
||||
*/
|
||||
protected String getScopeDescription() {
|
||||
return findAction.getScopeDescription();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.search.actions.FindAction#getScope()
|
||||
*/
|
||||
protected ICSearchScope getScope() {
|
||||
// TODO Auto-generated method stub
|
||||
return findAction.getScope();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.ui.search.actions.FindAction#getLimitTo()
|
||||
*/
|
||||
protected LimitTo getLimitTo() {
|
||||
return findAction.getLimitTo();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
ISelection sel = getSelection();
|
||||
|
||||
if (sel instanceof IStructuredSelection){
|
||||
findAction.run((IStructuredSelection) sel);
|
||||
}
|
||||
else if (sel instanceof ITextSelection){
|
||||
findAction.run((ITextSelection) sel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue