Skip to content
Snippets Groups Projects
Commit c329fec6 authored by tj's avatar tj
Browse files

fixed issue #5: all elements like channels; goal: input only for transitions,...

fixed issue #5: all elements like channels; goal: input only for transitions, markings only for places
parent b19ff8e2
No related branches found
No related tags found
No related merge requests found
......@@ -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
})
);
}
......
......@@ -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
})
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment