To disable/hide tool palette in GLSP's vscode extension. #504
-
I am using GLSP's vscode extension(https://github.com/eclipse-glsp/glsp-vscode-integration). My requirement is to disable/hide tool palette as it is not required in my implementation. Currently toolPaletteModule is a default module. But is not exported, so we cannot unbind this module. Any alternative way to disable/hide tool palette? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @sathya-1994,
import toolPaletteModule from '@eclipse-glsp/client/lib/features/tool-palette/di.config';
class WorkflowGLSPStarter extends GLSPStarter {
createContainer(diagramIdentifier: SprottyDiagramIdentifier): Container {
const container = createWorkflowDiagramContainer(diagramIdentifier.clientId);
container.unload(toolPaletteModule);
return container;
}
} |
Beta Was this translation helpful? Give feedback.
Hi @sathya-1994,
the default exports of the @eclipse-glsp/client package are incomplete and inconsistent at the moment. I opened #505 to track this.
Nevertheless, you have two options to hide/remove the tool palette from your diagram editor.
For this you simply have to overwrite the
GLSPVscodeDiagramWidget.initializeSprotty()
method and remove the dispatching of theEnableToolPaletteAction
(https://github.com/eclipse-glsp/glsp-vscode-integration/blob/f8202b835799ee8905b526ff7b9a28ea849ed6f1/packages/vscode-integration-webview/src/glsp-vscode-diagram-widget.ts#L34)Note this just hides the tool palette, but does not completely remove the…