-
Again, I've looked at the coffee editor frontend TypeScript, but I'm still lost. I want to intercept a double-click on a node in a GLSP diagram and take some action. I can't figure out where to put event handling code like that. Any help? Sorry for my lack of understanding and TIA. original thread by GaryKopp |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To handle client interactions like mouse clicks etc. you need to register a client tool and react by sending actions which then can either be handled on the client by registering an action handler there, or by registering the server as a handler for that action. |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Thank you very much Philip. I apologize for asking this before actually studying GLSP, which I will do now. |
Beta Was this translation helpful? Give feedback.
To handle client interactions like mouse clicks etc. you need to register a client tool and react by sending actions which then can either be handled on the client by registering an action handler there, or by registering the server as a handler for that action.
There are a few examples for registering a client action is in the glsp client core, such as https://github.com/eclipse-glsp/glsp-client/blob/master/packages/client/src/features/edit-label/edit-label-tool.ts
The only difference is that you register such a tool only in your language-specific DI module.
There is also an example for registering a client handler (see the usage of configureCommand()):
https://github.com/eclipse-glsp/gl…