Calling UI Actions

Hi,

is it possible to invoke programmatically the UI actions, such as "run program" or "open file" ?

If it's possible, is there a documentation that describes the corresponding API? :-)


Domenik
1 comment
There is InvokeActionStatement concept in jetbrains.mps.lang.test language, so you can use it to call actions either by ID or having a direct reference to an action in MPS.

The code generated from this language construction is very simple:
AnAction action = ActionManager.getInstance().getAction(actionId);
AnActionEvent event = ActionUtils.createEvent(ActionPlaces.MAIN_MENU, BaseEditorTestBody.DATA_MANAGER.getDataContext(editorComponent));
action.actionPerformed(event);
prettyPrint();
so another option is to just copy-paste it to your code..
0

Please sign in to leave a comment.