How to define an Action with multiple models as context? Follow
We have split a model into multiple models. Now we would like to run an Action on those multiple models, but the action context parameters don't allow to specify a List of models. Is there a way to specify this?
We also noticed that when selecting multiple models, the Action runs on the first model. The action however has only one model as context parameter. This does not look correct.
Kind Regards, Arjan Kok.
Please sign in to leave a comment.
Import jetbrains.mps.ide.actions@java_stub if it's not already imported and use a context parameter with MPSCommonDataKeys.MODELS key.
Thank you very much.
Instead of model the action has now List<SModel> as context parameter. Is there an easy way to 'upcast' SModel to model? So I can do things like for example model.roots(<type>)
Kind Regards, Arjan.
They are type-compatible so just assign SModel to a variable of type model.