Skip to content

Commit

Permalink
glsp#12 Add initial support for copy & paste (#25)
Browse files Browse the repository at this point in the history
* glsp#12 Add initial support for copy & paste

* Fix broken delete context menu item

We've recently renamed the operation kind of delete. This
broke the reuse of Sprotty's delete context menu item provider.
To fix it, we have to provide our own provider with the correct
action.
  • Loading branch information
planger committed Jan 29, 2020
1 parent b372a5e commit 1d00e5f
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 175 deletions.
7 changes: 4 additions & 3 deletions client/workflow/workflow-sprotty/src/di.config.ts
Expand Up @@ -27,7 +27,7 @@ import {
decorationModule,
defaultGLSPModule,
defaultModule,
DeleteContextMenuItemProvider,
DeleteElementContextMenuItemProvider,
DiamondNodeView,
edgeLayoutModule,
editLabelFeature,
Expand All @@ -42,6 +42,7 @@ import {
GLSPGraph,
glspMouseToolModule,
glspSelectModule,
glspServerCopyPasteModule,
GridSnapper,
hoverModule,
HtmlRoot,
Expand Down Expand Up @@ -91,7 +92,7 @@ const workflowDiagramModule = new ContainerModule((bind, unbind, isBound, rebind
bind(GLSP_TYPES.IMovementRestrictor).to(NoOverlapMovmentRestrictor).inSingletonScope();
bind(TYPES.ISnapper).to(GridSnapper);
bind(TYPES.ICommandPaletteActionProvider).to(RevealNamedElementActionProvider);
bind(TYPES.IContextMenuItemProvider).to(DeleteContextMenuItemProvider);
bind(TYPES.IContextMenuItemProvider).to(DeleteElementContextMenuItemProvider);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', GLSPGraph, SGraphView);
configureModelElement(context, 'task:automated', TaskNode, TaskNodeView);
Expand Down Expand Up @@ -119,7 +120,7 @@ export default function createContainer(widgetId: string): Container {

container.load(decorationModule, validationModule, defaultModule, glspMouseToolModule, defaultGLSPModule, glspSelectModule, boundsModule, viewportModule,
hoverModule, fadeModule, exportModule, expandModule, openModule, buttonModule, modelSourceModule, labelEditModule, labelEditUiModule, glspEditLabelValidationModule,
workflowDiagramModule, saveModule, executeCommandModule, toolFeedbackModule, modelHintsModule, contextMenuModule, glspContextMenuModule,
workflowDiagramModule, saveModule, executeCommandModule, toolFeedbackModule, modelHintsModule, contextMenuModule, glspContextMenuModule, glspServerCopyPasteModule,
commandPaletteModule, glspCommandPaletteModule, paletteModule, requestResponseModule, routingModule, edgeLayoutModule, zorderModule,
layoutCommandsModule);

Expand Down

0 comments on commit 1d00e5f

Please sign in to comment.