mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection tool window: select&expand first node + register shortcuts in swing thread
This commit is contained in:
@@ -145,12 +145,9 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
}
|
||||
});
|
||||
add(mySplitter, BorderLayout.CENTER);
|
||||
|
||||
createActionsToolbar();
|
||||
TreeUtil.selectFirstNode(myTree);
|
||||
}
|
||||
|
||||
|
||||
private void initTreeListeners() {
|
||||
myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
|
||||
@Override
|
||||
@@ -571,12 +568,14 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
}
|
||||
|
||||
private void registerActionShortcuts(@NotNull InspectionToolPresentation presentation) {
|
||||
final QuickFixAction[] fixes = presentation.getQuickFixes(RefEntity.EMPTY_ELEMENTS_ARRAY, null);
|
||||
if (fixes != null) {
|
||||
for (QuickFixAction fix : fixes) {
|
||||
fix.registerCustomShortcutSet(fix.getShortcutSet(), this);
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
final QuickFixAction[] fixes = presentation.getQuickFixes(RefEntity.EMPTY_ELEMENTS_ARRAY, null);
|
||||
if (fixes != null) {
|
||||
for (QuickFixAction fix : fixes) {
|
||||
fix.registerCustomShortcutSet(fix.getShortcutSet(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.codeInspection.ui;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
|
||||
@@ -60,6 +61,10 @@ public class InspectionTreeUpdater {
|
||||
}
|
||||
} finally {
|
||||
tree.setQueueUpdate(false);
|
||||
if (tree.getSelectionModel().getMinSelectionRow() == -1) {
|
||||
TreeUtil.selectFirstNode(tree);
|
||||
tree.expandRow(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user