IDEA actions generation

Hi!

How can I create actions dynamically?

I need a popup menu with items like:
"set variable i = 1 and do something in editor","set variable i = 2 and do the same in editor","set variable i = 3 and do the same in editor", etc.

Number of menu items is tuned dynamically by user.

2 comments
Comment actions Permalink

Hi Alex,

Alex Niden wrote:

Hi!

How can I create actions dynamically?

I need a popup menu with items like:
"set variable i = 1 and do something in editor","set variable i = 2 and do the same in editor","set variable i = 3 and do the same in editor", etc.

Number of menu items is tuned dynamically by user.


Extend your action from ActionGroup class and define
getChildren(AnActionEvent e) method. As long as ActionGroup extends
AnAction you can put it to plugin.xml.

Regards,
KIR

--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Thank you very much!

0

Please sign in to leave a comment.