Calling UI Actions


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? :-)

1 comment
Comment actions Permalink
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));
so another option is to just copy-paste it to your code..

Please sign in to leave a comment.