first steps to start with custom model #1042
-
Hi, I want to start customizing the java-emf-theia example, but i can not find how to load my own .ecore model. Please, could you tell me where can I find some documentation or first steps? My first goal is only try to add one more node element to the palette. Thanks a lot in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @julen9, I assume you have seen the README and the 'Next Steps' they are proposing with the referenced documentation. In the example repository, we use the TaskListSourceModelStorage to properly set up our resource set that is used when loading a model from a URI provided by the If you want to add one more node element - that does not yet exist in the model.ecore - to the palette, your first step would be to add it to the ecore (or replace it with your own file if you already have one) and then re-generate the model code using the model.genmodel file. This will create the new sources in the Afterwards, you need to make sure that your semantic element is properly translated to something that GLSP understands, i.e., the Graphical Model Structure. One very important aspect is the
I've also quickly sketched this on an example branch here: eclipse-glsp/glsp-examples@master...example-javaemftheia-extension Hope that gets you started in the right direction. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @martin-fleck-at , Very userful answer. I created a new model (ecore and genmodel) and I generated all the classes and implemented a brand new classes to create a new glsp-server with my model. Now, I'm working on the client side. I will be back with new questions. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Hi @julen9,
I assume you have seen the README and the 'Next Steps' they are proposing with the referenced documentation.
In the example repository, we use the TaskListSourceModelStorage to properly set up our resource set that is used when loading a model from a URI provided by the
RequestModelAction
from the client. The crucial part here is that the resource set that we use to load the model knows about our custom Ecore-based package so we need to register our package accordingly.If you want to add one more node element - that does not yet exist in the model.ecore - to the palette, your first step would be to add it to the ecore (or replace it with your own file if you already have one)…