Custom EditCell
Hi, I am playing with MPS and I would like to implement a custom EditCell.
I have to implement this EditCellProvider which should return EditCells. WHere I can find information on the methods to implement? There are abstract classes partially implementing EditCell which I am suppose to extend?
Thank you a lot,
Federico Tomassetti
Please sign in to leave a comment.
Hi!
Unfortunately we do not have (i think any) documentation describing how to extend MPS editor with your custom Cells. Basicly to extend editor with your custom cells you have to:
this is all you need to do for this task, but you'll probably need some more details concerning these steps, so do not hesitate to ask me. :-)
Concerning your questions about existing code reuse - you can extends your CustomEditorCell (runtime model) either from jetbrains.mps.nodeEditor.cells.EditorCell_Collection or jetbrains.mps.nodeEditor.cells.EditorCell_Label (or any other EditorCell interface implementors if you need your really custom cells)
I just realized that I actually did not answer original question ;-)
$custom cell$ can be used, as you properly mentioned, to point to a sub-class of AbstractCellProvider. Sub-classes of AbstractCellProvider will be generated by MPS for each of defined "editor component" (except of an editor in MPS you can define "reusable" editor component for any concept). I doubt it make sense to reuse any of MPS-generated AbstractCellProvider subclasses - in this case you can just reuse corresponding editor components directly in editor definition.
In case you'd like to create some custom EditorCell subclasses and use these subclasses in an editor with a sub-class of AbstractCellProvider you can initialize corresponding runtime cell hierarchy ad plug it into MPS editor. In a bit more sophisticated or generic situations then you need to parametrize custom EditorCell you have to probably follow my first suggestion. ;-)