add a new file in the sandbox in language generation aspect
Hello foroum!
I tried to add a new file to my sandbox when clicking on build sandbox model.
following code
Unfortunately, no new file appears in the sandbox.
Can someone pls point me into the right direction
Regards,
msch95
I tried to add a new file to my sandbox when clicking on build sandbox model.
following code
model.add root(mynode)
Unfortunately, no new file appears in the sandbox.
Can someone pls point me into the right direction
Regards,
msch95
Please sign in to leave a comment.
ModelAccess.instance().runWriteActionInCommand(new Runnable() { public void run() { node<Inputs> inputs = new node<Inputs>(); inputs.name = "Hello World"; SNode result = (SNode) NodeFactoryManager.createNode(concept/Inputs/, null, null, this.rootNode.model); this.rootNode.model.new root node(Inputs); this.rootNode.model.add root(result); } });Unfortunately, none of them works. I followed that:
https://confluence.jetbrains.com/display/MPSD32/Open+API+-+accessing+models+from+code
and that
http://www.programcreek.com/java-api-examples/index.php?api=jetbrains.mps.smodel.action.NodeFactoryManager
Then in another model called 'sandbox' the user clicks this button and then it imports data from xml and create new root concepts of "Inputs" (filled with the xml data) in separate files in the 'sandbox' model.
Solved it using
add to mbeddrPlatforumModelGroup at position <default>
in my action group and adding following code in my write action
write action { this.mod.add root(new node<Inputs>()); }