void searchForReferences(IType type, Collection results) throws JavaModelException { this.results = results; //Hack because of a bug in the search engine in eclipse 2.1.1 try { engine.searchDeclarationsOfReferencedTypes(type, this, null); } catch (ClassCastException ex) { Logger.getLogger().logError(ex); } } public void acceptSearchMatch(SearchMatch match) throws CoreException {
private static List<SearchMatch> getTypeReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException { CollectingSearchRequestor requestor= new CollectingSearchRequestor(); SearchEngine engine= owner != null ? new SearchEngine(owner) : new SearchEngine(); engine.searchDeclarationsOfReferencedTypes(element, requestor, pm); return requestor.getResults(); }
private static List<SearchMatch> getTypeReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException { CollectingSearchRequestor requestor= new CollectingSearchRequestor(); SearchEngine engine= owner != null ? new SearchEngine(owner) : new SearchEngine(); engine.searchDeclarationsOfReferencedTypes(element, requestor, pm); return requestor.getResults(); }
/** * Performs the search of referenced types. * * @param element the java element whose referenced types have to be found * @param monitor the progress monitor, or <code>null</code> * @throws JavaModelException if an error occurs during search */ public final void searchReferencedTypes(final IJavaElement element, IProgressMonitor monitor) throws JavaModelException { Assert.isNotNull(element); if (monitor == null) { monitor= new NullProgressMonitor(); } try { monitor.beginTask("", 1); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.RefactoringSearchEngine_searching_referenced_types); try { SearchEngine engine= null; if (fOwner != null) { engine= new SearchEngine(fOwner); } else { engine= new SearchEngine(fWorkingCopies); } engine.searchDeclarationsOfReferencedTypes(element, getCollector(), new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); } catch (CoreException exception) { throw new JavaModelException(exception); } } finally { monitor.done(); } }
private static List<SearchMatch> getTypeReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException { CollectingSearchRequestor requestor= new CollectingSearchRequestor(); SearchEngine engine= owner != null ? new SearchEngine(owner) : new SearchEngine(); engine.searchDeclarationsOfReferencedTypes(element, requestor, pm); return requestor.getResults(); }
private static List getTypeReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException { CollectingSearchRequestor requestor= new CollectingSearchRequestor(); SearchEngine engine= owner != null ? new SearchEngine(owner) : new SearchEngine(); engine.searchDeclarationsOfReferencedTypes(element, requestor, pm); return requestor.getResults(); }
/** * Performs the search of referenced types. * * @param element the java element whose referenced types have to be found * @param monitor the progress monitor, or <code>null</code> * @throws JavaModelException if an error occurs during search */ public final void searchReferencedTypes(final IJavaElement element, IProgressMonitor monitor) throws JavaModelException { Assert.isNotNull(element); if (monitor == null) monitor= new NullProgressMonitor(); try { monitor.beginTask("", 1); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.RefactoringSearchEngine_searching_referenced_types); try { SearchEngine engine= null; if (fOwner != null) engine= new SearchEngine(fOwner); else engine= new SearchEngine(fWorkingCopies); engine.searchDeclarationsOfReferencedTypes(element, getCollector(), new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); } catch (CoreException exception) { throw new JavaModelException(exception); } } finally { monitor.done(); } }
/** * Performs the search of referenced types. * * @param element the java element whose referenced types have to be found * @param monitor the progress monitor, or <code>null</code> * @throws JavaModelException if an error occurs during search */ public final void searchReferencedTypes(final IJavaElement element, IProgressMonitor monitor) throws JavaModelException { Assert.isNotNull(element); if (monitor == null) monitor= new NullProgressMonitor(); try { monitor.beginTask("", 1); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.RefactoringSearchEngine_searching_referenced_types); try { SearchEngine engine= null; if (fOwner != null) engine= new SearchEngine(fOwner); else engine= new SearchEngine(fWorkingCopies); engine.searchDeclarationsOfReferencedTypes(element, getCollector(), new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); } catch (CoreException exception) { throw new JavaModelException(exception); } } finally { monitor.done(); } }
/** * Performs the search of referenced types. * * @param element the java element whose referenced types have to be found * @param monitor the progress monitor, or <code>null</code> * @throws JavaModelException if an error occurs during search */ public final void searchReferencedTypes(final IJavaElement element, final IProgressMonitor monitor) throws JavaModelException { Assert.isNotNull(element); try { monitor.beginTask("", 1); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.RefactoringSearchEngine_searching_referenced_types); try { SearchEngine engine= null; if (fOwner != null) engine= new SearchEngine(fOwner); else engine= new SearchEngine(fWorkingCopies); engine.searchDeclarationsOfReferencedTypes(element, getCollector(), new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); } catch (CoreException exception) { throw new JavaModelException(exception); } } finally { monitor.done(); } }