/* (non-JavaDoc) * Method declared in SelectionDispatchAction. */ public final void run(ITextSelection ts) { ITypeRoot input = getEditorInput(fEditor); if (!ActionUtil.isProcessable(getShell(), input)) return; OccurrencesFinder finder = new OccurrencesFinder(); FindOccurrencesEngine engine = FindOccurrencesEngine.create(finder); try { String result = engine.run(input, ts.getOffset(), ts.getLength()); if (result != null) showMessage(getShell(), fEditor, result); } catch (JavaModelException e) { JavaPlugin.log(e); } }
public void run(IStructuredSelection selection) { IMember member = getMember(selection); if (!ActionUtil.isProcessable(getShell(), member)) return; FindOccurrencesEngine engine = FindOccurrencesEngine.create(new OccurrencesFinder()); try { ISourceRange range = member.getNameRange(); String result = engine.run(member.getTypeRoot(), range.getOffset(), range.getLength()); if (result != null) showMessage(getShell(), fActionBars, result); } catch (JavaModelException e) { JavaPlugin.log(e); } }