-
I am trying to customize tools module, however I am unable to figure out how should I access palette items added from server side. Please help me on this. original thread by vibsid0986 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
On initialization of the tool palette, the client sends a |
Beta Was this translation helpful? Give feedback.
-
Note: You don't have to reimplement the entire
|
Beta Was this translation helpful? Give feedback.
-
[vibsid0986] |
Beta Was this translation helpful? Give feedback.
-
[vibsid0986] @planger(planger) and @tortmayr(tortmayr) thanks for replying. Can you help me with what is the method in the attached SS is doing. Is it triggering node creation when I click on a palette item? |
Beta Was this translation helpful? Give feedback.
-
This method returns a function that is registered as a mouse listener. The mouse listener reacts to the mouse event and tests whether the editor is in readonly mode. If it isn't, it dispatches the action of the respective tool palette item via the action dispatcher. The action dispatcher will then look up the registered handlers and invoke them with the actions. |
Beta Was this translation helpful? Give feedback.
-
[vibsid0986] @planger(planger), thanks for quick response. Understood!! |
Beta Was this translation helpful? Give feedback.
On initialization of the tool palette, the client sends a
RequestContextAction
with the context ToolPalette.ID to the server. The items responded by the server are then shown in the palette. The client code is here:https://github.com/eclipse-glsp/glsp-client/blob/884f860bf2732ca9551ab6ff34647c249c224262/packages/client/src/features/tool-palette/tool-palette.ts#L309
So the retrieved items sent by the server are stored in the field
this.paletteItems
of theToolPalette
instance, which itself is a UI extension.