How to define an Action with multiple models as context?

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.

4 comments
Comment actions Permalink

Import jetbrains.mps.ide.actions@java_stub if it's not already imported and use a context parameter with MPSCommonDataKeys.MODELS key.

2
Comment actions Permalink

Thank you very much.

0
Comment actions Permalink

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.

0
Comment actions Permalink

They are type-compatible so just assign SModel to a variable of type model.

3

Please sign in to leave a comment.