Custom models / modules for RCP Follow
I'm looking for a way to add custom information to modules and models my language users interact with.
When users of my RCP interact, they should not have to think in "modules" and "models". Instead, I want them to interact with customized versions of both modules and models. Similarly as we have "Solution" and "Language" as customized modules in MPS or "structure"-, and "editor"-aspects as customized models.
I can see different ways on how to implement that, but I wonder if there are recommendations, best practices, or some documentation someone could point me to (didn't find much myself).
Best case scenario from my current point of view would be there to be some API that allows me to "annotate" models and modules with additional information (e.g. some payload or something) which allows me to make the necessary distinction in the RCP UI. I would really like to avoid having to implement my own SModules and SModels, since I believe that would also require to add some custom persistency logic to persist my customizations.
Please sign in to leave a comment.
So, regarding models, I found the ModelWithAttributes interface which seems to meet my requirements.
Regarding modules, I tried to (mis-?)use facets in order to provide my own module kinds. Never used facets before, not sure if they are meant to be used in a way like this, but maybe someone can share some knowledge on facets and how one would provide their own facet to a module programmatically?
Amongst other things, I tried somethjing like this:
This results in:
Is there a hook to register a factory for my facet?
I tried adding something like:
This results in this exception, which tells me that I cannot use this API in the context of an Action:
I might be completely on the wrong track, though.