ui: keep selection in Keymap settings on clearing of Shortcut filter

TreeExpansionMonitor does not support reentrant freezing.
So calls like:

   myTreeExpansionMonitor.freeze();
   myFilteringPanel.setShortcut(null); // triggers `filterTreeByShortcut`
   doSmth();
   myTreeExpansionMonitor.restore();

did not work as expected, because `doSmth()` was performed without
monitor state being frozen.
This commit is contained in:
Aleksey Pivovarov
2017-10-17 12:23:24 +03:00
parent c081558a38
commit 9af10f3f20
@@ -330,11 +330,12 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
}
private void filterTreeByShortcut(Shortcut shortcut) {
myTreeExpansionMonitor.freeze();
boolean wasFreezed = myTreeExpansionMonitor.isFreeze();
if (!wasFreezed) myTreeExpansionMonitor.freeze();
myActionsTree.filterTree(shortcut, myQuickLists);
final JTree tree = myActionsTree.getTree();
TreeUtil.expandAll(tree);
myTreeExpansionMonitor.restore();
if (!wasFreezed) myTreeExpansionMonitor.restore();
}
public void showOption(String option) {