inspection toolwindow: do not use obsolete event IDEA-156354

This commit is contained in:
Dmitry Batkovich
2016-05-27 20:16:05 +03:00
parent d248b2a932
commit a3457508b2
@@ -130,7 +130,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction {
if (isProblemDescriptorsAcceptable() && descriptors.get().length > 0) {
doApplyFix(view.getProject(), descriptors.get(), readOnlyFiles, tree.getContext());
} else {
doApplyFix(getSelectedElements(e), view);
doApplyFix(getSelectedElements(view), view);
}
} finally {
view.setApplyingFix(false);
@@ -222,11 +222,10 @@ public class QuickFixAction extends AnAction implements CustomComponentAction {
return readOnlyFiles;
}
private static RefEntity[] getSelectedElements(AnActionEvent e) {
final InspectionResultsView invoker = getInvoker(e);
if (invoker == null) return new RefElement[0];
List<RefEntity> selection = new ArrayList<>(Arrays.asList(invoker.getTree().getSelectedElements()));
PsiDocumentManager.getInstance(invoker.getProject()).commitAllDocuments();
private static RefEntity[] getSelectedElements(InspectionResultsView view) {
if (view == null) return new RefElement[0];
List<RefEntity> selection = new ArrayList<>(Arrays.asList(view.getTree().getSelectedElements()));
PsiDocumentManager.getInstance(view.getProject()).commitAllDocuments();
Collections.sort(selection, (o1, o2) -> {
if (o1 instanceof RefElement && o2 instanceof RefElement) {
RefElement r1 = (RefElement)o1;