From c329fec6df5e908a94665e0eb6181aed1c649d4d Mon Sep 17 00:00:00 2001 From: tj <tim6542@aol.com> Date: Sun, 19 Jan 2025 13:27:01 +0100 Subject: [PATCH] fixed issue #5: all elements like channels; goal: input only for transitions, markings only for places --- .../src/browser/diagram/edit-input-signals-context-menu.ts | 4 ++-- .../src/browser/diagram/reset-markings-context-menu.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glsp-client/tasklist-theia/src/browser/diagram/edit-input-signals-context-menu.ts b/glsp-client/tasklist-theia/src/browser/diagram/edit-input-signals-context-menu.ts index 94b668e..e5bbb7a 100644 --- a/glsp-client/tasklist-theia/src/browser/diagram/edit-input-signals-context-menu.ts +++ b/glsp-client/tasklist-theia/src/browser/diagram/edit-input-signals-context-menu.ts @@ -18,7 +18,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core'; import { ApplicationShell } from '@theia/core/lib/browser'; import { inject, injectable } from 'inversify'; -import { EditInputSignalMenu } from 'tasklist-glsp'; +import { isTransition, EditInputSignalMenu } from 'tasklist-glsp'; export namespace EditInputSignalsMenuCommand { export const EDIT_INPUT_SIGNALS_MENU = 'edit-input-signals-menu-command'; @@ -37,7 +37,7 @@ export class EditInputSignalsMenuCommandContribution implements CommandContribut visible: true }) ], - isEnabled: context => !context.isReadonly + isEnabled: context => !context.isReadonly && context.selectedElements.filter(isTransition).length === 1 }) ); } diff --git a/glsp-client/tasklist-theia/src/browser/diagram/reset-markings-context-menu.ts b/glsp-client/tasklist-theia/src/browser/diagram/reset-markings-context-menu.ts index 9fbfea1..2f00eba 100644 --- a/glsp-client/tasklist-theia/src/browser/diagram/reset-markings-context-menu.ts +++ b/glsp-client/tasklist-theia/src/browser/diagram/reset-markings-context-menu.ts @@ -17,7 +17,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core'; import { ApplicationShell } from '@theia/core/lib/browser'; import { inject, injectable } from 'inversify'; -import { ResetMarkingsOperation } from 'tasklist-glsp'; +import { isPlace, ResetMarkingsOperation } from 'tasklist-glsp'; export namespace ResetMarkingsCommand { export const RESET_MARKINGS = 'reset-markings-command'; @@ -31,7 +31,7 @@ export class ResetMarkingsCommandContribution implements CommandContribution { { id: ResetMarkingsCommand.RESET_MARKINGS, label: 'Reset Markings' }, new GLSPCommandHandler(this.shell, { actions: context => [ResetMarkingsOperation.create()], - isEnabled: context => !context.isReadonly + isEnabled: context => !context.isReadonly && context.selectedElements.filter(isPlace).length === 1 }) ); } -- GitLab