@Override protected IStatus doRun(ProgressMonitor monitor) { try { if (VIRTUAL) { internalRunVirtual(monitor); } else { internalRun(monitor); } } catch (CoreException e) { fViewer.searchJobFailed(fTicket, e); return new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, JavaUIMessages.TypeInfoViewer_job_error, e); } catch (InterruptedException e) { return canceled(e, true); } catch (OperationCanceledException e) { return canceled(e, false); } fViewer.searchJobDone(fTicket); return ok(); } protected abstract TypeNameMatch[] getSearchResult(Set matchIdsInHistory, ProgressMonitor monitor) throws CoreException;
return; TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); fViewer.fExpectedItemCount+= result.length; if (result.length == 0) {
return; TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); fViewer.fExpectedItemCount+= result.length; if (result.length == 0) {
return; TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); fViewer.fExpectedItemCount+= result.length; if (result.length == 0) {
private void internalRunVirtual(ProgressMonitor monitor) throws CoreException, InterruptedException { if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.clear(fTicket); TypeNameMatch[] matchingTypes= fHistory.getFilteredTypeInfos(fFilter); fViewer.setHistoryResult(fTicket, matchingTypes); if ((fMode & INDEX) == 0) return; Set filteredMatches= new HashSet(matchingTypes.length * 2); for (int i= 0; i < matchingTypes.length; i++) { filteredMatches.add(matchingTypes[i]); } TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.setSearchResult(fTicket, result); } private IStatus canceled(Exception e, boolean removePendingItems) {
@Override protected IStatus doRun(ProgressMonitor monitor) { try { if (VIRTUAL) { internalRunVirtual(monitor); } else { internalRun(monitor); } } catch (CoreException e) { fViewer.searchJobFailed(fTicket, e); return new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, JavaUIMessages.TypeInfoViewer_job_error, e); } catch (InterruptedException e) { return canceled(e, true); } catch (OperationCanceledException e) { return canceled(e, false); } fViewer.searchJobDone(fTicket); return ok(); } protected abstract TypeNameMatch[] getSearchResult(Set matchIdsInHistory, ProgressMonitor monitor) throws CoreException;
private void internalRunVirtual(ProgressMonitor monitor) throws CoreException, InterruptedException { if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.clear(fTicket); TypeNameMatch[] matchingTypes= fHistory.getFilteredTypeInfos(fFilter); fViewer.setHistoryResult(fTicket, matchingTypes); if ((fMode & INDEX) == 0) return; Set filteredMatches= new HashSet(matchingTypes.length * 2); for (int i= 0; i < matchingTypes.length; i++) { filteredMatches.add(matchingTypes[i]); } TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.setSearchResult(fTicket, result); } private IStatus canceled(Exception e, boolean removePendingItems) {
private void internalRunVirtual(ProgressMonitor monitor) throws CoreException, InterruptedException { if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.clear(fTicket); TypeNameMatch[] matchingTypes= fHistory.getFilteredTypeInfos(fFilter); fViewer.setHistoryResult(fTicket, matchingTypes); if ((fMode & INDEX) == 0) return; Set filteredMatches= new HashSet(matchingTypes.length * 2); for (int i= 0; i < matchingTypes.length; i++) { filteredMatches.add(matchingTypes[i]); } TypeNameMatch[] result= getSearchResult(filteredMatches, monitor); if (monitor.isCanceled()) throw new OperationCanceledException(); fViewer.setSearchResult(fTicket, result); } private IStatus canceled(Exception e, boolean removePendingItems) {
protected IStatus doRun(ProgressMonitor monitor) { try { if (VIRTUAL) { internalRunVirtual(monitor); } else { internalRun(monitor); } } catch (CoreException e) { fViewer.searchJobFailed(fTicket, e); return new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, JavaUIMessages.TypeInfoViewer_job_error, e); } catch (InterruptedException e) { return canceled(e, true); } catch (OperationCanceledException e) { return canceled(e, false); } fViewer.searchJobDone(fTicket); return ok(); } protected abstract TypeNameMatch[] getSearchResult(Set matchIdsInHistory, ProgressMonitor monitor) throws CoreException;
private void scheduleSearchJob(int mode) { fSearchJobTicket++; if (fLastCompletedFilter != null && fTypeInfoFilter.isSubFilter(fLastCompletedFilter.getText())) { fSearchJob= new CachedResultJob(fSearchJobTicket, fLastCompletedResult, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode); } else { fLastCompletedFilter= null; fLastCompletedResult= null; fSearchJob= new SearchEngineJob(fSearchJobTicket, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode, fSearchScope, fElementKind); } fSearchJob.schedule(); }
private void scheduleSearchJob(int mode) { fSearchJobTicket++; if (fLastCompletedFilter != null && fTypeInfoFilter.isSubFilter(fLastCompletedFilter.getText())) { fSearchJob= new CachedResultJob(fSearchJobTicket, fLastCompletedResult, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode); } else { fLastCompletedFilter= null; fLastCompletedResult= null; fSearchJob= new SearchEngineJob(fSearchJobTicket, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode, fSearchScope, fElementKind); } fSearchJob.schedule(); }
private void scheduleSearchJob(int mode) { fSearchJobTicket++; if (fLastCompletedFilter != null && fTypeInfoFilter.isSubFilter(fLastCompletedFilter.getText())) { fSearchJob= new CachedResultJob(fSearchJobTicket, fLastCompletedResult, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode); } else { fLastCompletedFilter= null; fLastCompletedResult= null; fSearchJob= new SearchEngineJob(fSearchJobTicket, this, fTypeInfoFilter, fHistory, fNumberOfVisibleItems, mode, fSearchScope, fElementKind); } fSearchJob.schedule(); }
public void stop() { cancel(); } @Override
public void stop() { cancel(); } protected IStatus doRun(ProgressMonitor monitor) {
public void stop() { cancel(); } @Override
@Override public void stop() { fReqestor.cancel(); super.stop(); } @Override
public void stop(boolean stopSyncJob, boolean dispose) { if (fSyncJob != null && stopSyncJob) { fSyncJob.stop(); fSyncJob= null; } if (fSearchJob != null) { fSearchJob.stop(); fSearchJob= null; } }
public void stop() { fReqestor.cancel(); super.stop(); } protected TypeNameMatch[] getSearchResult(Set matchIdsInHistory, ProgressMonitor monitor) throws CoreException {
public void stop(boolean stopSyncJob, boolean dispose) { if (fSyncJob != null && stopSyncJob) { fSyncJob.stop(); fSyncJob= null; } if (fSearchJob != null) { fSearchJob.stop(); fSearchJob= null; } }
@Override public void stop() { fReqestor.cancel(); super.stop(); } @Override