Dynamic Ghost Node Creation (glsp-node-server) #1721
Replies: 2 comments 1 reply
|
@martin-fleck-at Can you please have a look at this? |
|
@jmenzies12 So when we introduced the ghost elements we already introduced a So the first thing you need to do is to make sure that you set the dynamic flag in our server, e.g.: override createTriggerGhostElement(): GhostElement | undefined {
...
return { template: builder.build(), dynamic: true };
}(for instance, we also do this for our create task handlers). Now the question is how to trigger the
We might want to consider creating a dedicated refresh action for the palette so it can be triggered from other places as well but for now this should help you get started. If you have any further questions, please let me know. |
Uh oh!
There was an error while loading. Please reload this page.
Hey folks,
Is it possible to make the ghost node creation dynamic?
The code to create the ghost nodes, defined under JsonCreateNodeOperationHandler is triggered when the diagram is opened. That means that we are unable to change the color of the node dynamically based on a vscode preference,
Currently we do something similar to this, but if the preference changes whilst the diagram is open the ghost element does not get refreshed so it keeps the previously set color.
Example code:
Cheers
Jonathan
All reactions