mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Some components, like `IrbRubyLanguageConsoleView`, don't register custom actions right away in constructor. They may postpone it, for example, until when a component is first shown. The old code in `ActionConverterUtil` didn't handle such cases, leaving a component without actions, or only with some of them. This commit supports listening for action changes and updating them during the lifetime of a component. The main flaw still left untouched in this commit is `if (contextActions.isEmpty()) return control` line. If, at the moment of a component conversion, there are no custom actions, they will not be listened to in the future as well. This is left for now because of two reasons: 1. It still fixes GTW-6744. 2. Otherwise, **every single component** would be wrapped into an action behavior wrapper, which is a very high penalty for such a small feature. It is possible to introduce some markers in the future, to avoid the creation of wrapper for every component, still supporting some of them. But this can be done when it becomes actually needed. (cherry picked from commit e48b64be70d6908efa798aaaec2ee00985069740) IJ-CR-147506 GitOrigin-RevId: 90cb2b28a5dca84012b4c775de8d69251e5ce7da