mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
The problem: the action text for Reveal/Open In actions
is customized based on the action place. For RevealFileAction
it's done in the code (because it needs to figure out the file manager
name on Linux), for other actions it's done using text override
in XML. However, in practice shortened names make sense only
if the actions are located in the Reveal/Open In submenu.
If the action is in some other place of the same popup menu,
then the full name should be used ("Finder" doesn't make sense
if it's not located under "Reveal In").
The solution: do not rely on the action place in the action event.
Instead, customize RevealGroup so that it performs post-processing
of its children's presentations using the "correct" place, which is
a new string constant in ActionPlaces just for this group.
This approach allows to use the XML text override mechanism by
specifying this new place instead of listing all popups containing
the reveal in group.
For RevealFileAction, because the customization is performed
in the code, we have to override applyTextOverride. It's a big ugly,
but the alternative, to call addTextOverride() somewhere once,
isn't very elegant either because there doesn't seem to be a good
place to call it.
GitOrigin-RevId: 5c9e9a81bec1a29dcca29532208a930f16cd75d9