void (@NotNull Project project) { if (isInitialized.getAndSet(true)) return; MyProjectsTreeListener listener = new MyProjectsTreeListener(); MavenProjectsManager mavenProjectManager = MavenProjectsManager.getInstance(project); mavenProjectManager.addManagerListener(listener, this); mavenProjectManager.addProjectsTreeListener(listener, this); MessageBusConnection busConnection = ApplicationManager.getApplication().getMessageBus().connect(this); busConnection.subscribe(KeymapManagerListener.TOPIC, new KeymapManagerListener() { @Override public void activeKeymapChanged(Keymap keymap) { fireShortcutsUpdated(); } @Override public void shortcutChanged(@NotNull Keymap keymap, @NotNull String actionId) { fireShortcutsUpdated(); } }); }