-
Starting from the TaskList (java-emf-theia) example, I am trying to modify how the theia widget is created. In particular, I am trying to open the widget using a theia command from the command register. For that purpose, I have extended the class Q1: Where is the mistake? This is my frontend module: export class TaskListTheiaFrontendModule extends GLSPTheiaFrontendModule implements CommandContribution {
readonly diagramLanguage = TaskListLanguage;
bindDiagramConfiguration(context: ContainerContext): void {
context.bind(DiagramConfiguration).to(TaskListDiagramConfiguration);
}
registerCommands(commands: CommandRegistry): void {
commands.registerCommand(
{
id: 'tasklist-view',
label: 'Task List'
} , {
execute: () => Function.prototype() // TBD
});
}
override configureDiagramManager(context: ContainerContext): void {
context.bind(MyGLSPDiagramManager).to(MyGLSPDiagramManager).inSingletonScope();
registerDiagramManager(context.bind, MyGLSPDiagramManager);
}
} The bindings follow the documentation of /**
* Configures the bindings for the diagram manager of the diagram integration. A {@link ConfigurableGLSPDiagramManager}
* is bound to a generated service identifer in singleton scope and then additional bindings for this service
* identifer are registered. Can be overwritten in subclasses to provide a custom binding.
*
* For example:
* ```typescript
* context.bind(MyDiagramManager).to(MyDiagramManager).inSingletonScope();
* registerDiagramManager(context.bind, MyDiagramManager);
* ```
* @param context the container context
*/ And |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dmm9 ,
It looks like the documentation of override configureDiagramManager(context: ContainerContext): void {
registerDiagramManager(context.bind, MyGLSPDiagramManager);
} or override configureDiagramManager(context: ContainerContext): void {
context.bind(MyGLSPDiagramManager).to(MyGLSPDiagramManager).inSingletonScope();
registerDiagramManager(context.bind, MyGLSPDiagramManager,false);
}
You can use Theia's OpenerService for this.
Please be carefull with the useage of |
Beta Was this translation helpful? Give feedback.
Hi @dmm9 ,
It looks like the documentation of