void () { Application application = ApplicationManager.getApplication(); if (application == null) { return; } if (listenerDisposable == null) { listenerDisposable = Disposer.newDisposable(); Disposer.register(myParentDisposable, listenerDisposable); application.getMessageBus().connect(listenerDisposable).subscribe(KeymapManagerListener.TOPIC, new KeymapManagerListener() { @Override public void activeKeymapChanged(@Nullable Keymap keymap) { rebound(); } @Override public void shortcutChanged(@NotNull Keymap keymap, @NotNull String actionId) { if (myActionId == null || actionId.equals(myActionId)) { rebound(); } } }); } rebound(); }