mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection toolwindow: do not use obsolete event IDEA-156354
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user