void () { final MessageBusConnection connection = myProject.getMessageBus().connect(myParentDisposable); connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerListener() { @Override public void selectionChanged(@NotNull FileEditorManagerEvent event) { selectInAlarm(event.getNewEditor()); } }); updateCurrentSelection(); }