-
Hi, What I try to archive:
To create the context menu commands I followed the Workflow Example with its Navigation-Commands. So far things are working. I can provide the commands in Theia as also in Visual Code. I am also working on a tutorial about how to implement Context Menu Commands . So I am still optimistic to get my problem solved ;-) The Problem Now the problem is that I can react on the context menu commands on the server side by implementing a Each time I click the context menue I see the following warning on my client:
This is more or less expected, since I have not implemented a handler on the client side. So I tried to implement a Action Handler in my client code: export interface BPMNPropertyAction extends Action {
kind: typeof BPMNPropertyAction.KIND;
}
export namespace BPMNPropertyAction {
export const KIND = 'properties';
export function is(object: any): object is BPMNPropertyAction {
return Action.hasKind(object, KIND);
}
export function create(): BPMNPropertyAction {
return { kind: KIND };
}
}
@injectable()
export class BPMNPropertyActionHandler implements IActionHandler {
handle(action: BPMNPropertyAction): void | Action {
console.log('--------> custom action arrived');
// implement your custom logic to handle the action
// Optionally issue a response action
}
} And also register my handler in my DiagramModule ( ....
// Action Handler
configureActionHandler(context, BPMNPropertyAction.KIND, BPMNPropertyActionHandler);
... But this has no effect. I still see the warning on the client side. My questions are:
Thanks for any help or hints.... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @rsoika,
No, the context menu command is not always a In general you can dispatch any action in a commands.registerCommand(
{ id: "someId", label: 'BPMNPropertyAction' },
new GLSPCommandHandler(this.shell, {
actions: () => [BPMNPropertyAction.create()]
})
); Looking at your tutorial you could also rework it to not use a |
Beta Was this translation helpful? Give feedback.
-
Hi @tortmayr This is very strange. I saw that you did exactly the same with the |
Beta Was this translation helpful? Give feedback.
Hi @rsoika,
No, the context menu command is not always a
NaviateAction
I think you derived a false conclusion from looking at the Workflow Example and its Navigation-Commands.
Rather than being a generic API for handling all context menu actions the Navigation API is tailored for specific use cases.
It is used to implement complex navigation like
Go to next Node
,Go to reference
,Go to source
etc. where the client does not have all the necessary information to navigate to the correct target. In this cases the client triggers aNavigateAction
with a specific navigation target and the server is responsible f…