Skip to content

Can I get a sanity check on custom validation of GLSP actions? #76

Answered by planger
glsp-bot asked this question in All other
Discussion options

You must be logged in to vote

As you write the static node / edge type hints won't help if the logic of whether something is allowed or not is dynamic. So for those cases there are three approaches to deal with that:

  1. Reject the operation by not changing the model in the operation handler. If an operation handler doesn't do anything, the model won't be changed and the model update that is sent to the client will reset the model state on the client to the state before the operation.

  2. Perform the action and add an error marker by registering and implementing a validator (overwrite bindModelValidator() in the server module)

  3. Overwrite the client-side create create edge mouse tool (https://github.com/eclipse-glsp/glsp-…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by planger
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants