Find groupid for an action

Answered

Hello, in a plugin, is there a way to find the groupid from anActionEvent. Something like this:
( e.myActionManager).myId2GroupId.myMap.get(ACTION_ID)

All these have private access in ActionManager. I am looking for a public API.

0
3 comments

Hi,

Could you please clarify the case? Why do you need to access an action group id?

Also, what is the code you are referring to? I can't find any of "(e.myActionManager).myId2GroupId.myMap.get(ACTION_ID)".

0

Hello,

You can write this kind of code in the evaluate expression window in intellij. It allows you to access private methods/variables.

The use case is that I have two sets of menu items under two different groups ( because they are semantically different ) but they do similar things under the covers. Most of the code is common with minor differences. I was hoping if I knew which group the click came from I could switch my code to handle the minor differences.

Thanks

 

0

Hi,

Sorry, I was unclear. I meant that I can't even find any symbols like myId2GroupId but now I see it was renamed.

I don't see any API that allows achieving that but I also don't think it is a good idea to make your action logic dependent on the place it was invoked from. I suggest creating 2 separate actions sharing most of the code and providing the difference with some flag or overridden method.

0

Please sign in to leave a comment.