Creating concept editors programatically given list of sNode/
Hi,
How do i create a concept editor programatically for a given sNode object? I presume it is possible to set flags on cell collections programatically ( mainly 'uses folding' ) too as i would otherwise do by hand in the inspector?
Regards, Haider.
Please sign in to leave a comment.
A general advice to learn about lower level MPS java types is to look at the generated code for high level aspects. In your case, you could consult the generated code for a MPS editor.
You can use the open API in jetbrains.mps.openapi.editor to programmatically create your own editor cells. There'S also jetbrains.mps.nodeEditor with some helpful utilities to build cells programmatically. You need a node as well as a EditorContext object as context.
In de.slisson.mps.tables, there is also a handy high level language construct called CellCreateOperation that you can use to inline editor cell Editors in your baselanguage code.
setFoldable is here:
http://127.0.0.1:63320/node?ref=1ed103c3-3aa6-49b7-9c21-6765ee11f224%2Fjava%3Ajetbrains.mps.nodeEditor.cells%28MPS.Editor%2F%29%2F%7EEditorCell_Collection.setFoldedCell%2528jetbrains.mps.openapi.editor.cells.EditorCell%2529%3Avoid
Hi,
you can see some examples in my project (not up-to-date) https://github.com/mar9000/pe4mps.
Basically I wrote a syntax (PE) to define projectional editors than I've implemented, just a proof of concept, the import into MPS with pe4mps.
Take a look at the java class that does the import, there is a working example for the DOT/Graphvz language.
Basically you have to instantiate programmatically what the editor aspect let you instantiate graphically.
The MPS-extensions project has smarter/highl level cell editors.