cancel background task on progress cancelling (IDEA-83540)

This commit is contained in:
anna
2012-03-27 16:56:31 +02:00
parent 5822390cf2
commit 448fa70738
5 changed files with 33 additions and 15 deletions
@@ -245,7 +245,7 @@ public class MarkerType {
}
@Override
public void run(@NotNull ProgressIndicator indicator) {
public void run(@NotNull final ProgressIndicator indicator) {
super.run(indicator);
ClassInheritorsSearch.search(myClass, ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
@Override
@@ -255,7 +255,10 @@ public class MarkerType {
}), true).forEach(new CommonProcessors.CollectProcessor<PsiClass>() {
@Override
public boolean process(final PsiClass o) {
updateComponent(o, myRenderer.getComparator());
if (!updateComponent(o, myRenderer.getComparator())) {
indicator.cancel();
}
indicator.checkCanceled();
return super.process(o);
}
});
@@ -281,13 +284,16 @@ public class MarkerType {
}
@Override
public void run(@NotNull ProgressIndicator indicator) {
public void run(@NotNull final ProgressIndicator indicator) {
super.run(indicator);
OverridingMethodsSearch.search(myMethod, true).forEach(
new CommonProcessors.CollectProcessor<PsiMethod>() {
@Override
public boolean process(PsiMethod psiMethod) {
updateComponent(psiMethod, myRenderer.getComparator());
if (!updateComponent(psiMethod, myRenderer.getComparator())) {
indicator.cancel();
}
indicator.checkCanceled();
return super.process(psiMethod);
}
});