Files
openide/platform/editor-ui-api
Vyacheslav Moklev f065b84c36 [RDCT] GTW-6744: Support listening for custom shortcut actions
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
2024-10-24 15:19:13 +00:00
..
2024-09-27 13:47:17 +00:00