Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #140 from /issues/138-updateGLSP
Browse files Browse the repository at this point in the history
[138] Upgrade to latest GLSP version
  • Loading branch information
CamilleLetavernier authored Apr 10, 2020
2 parents 3b1f58b + bc6c59a commit de808d7
Show file tree
Hide file tree
Showing 29 changed files with 1,757 additions and 2,823 deletions.
51 changes: 25 additions & 26 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,31 @@
"tslint": "^5.5.0"
},
"resolutions": {
"**/@theia/editor": "0.14.0",
"**/@theia/filesystem": "0.14.0",
"**/@theia/languages": "0.14.0",
"**/@theia/monaco": "0.14.0",
"**/@theia/process": "0.14.0",
"**/@theia/application-manager": "0.14.0",
"**/@theia/application-package": "0.14.0",
"**/@theia/callhierarchy": "0.14.0",
"**/@theia/json": "0.14.0",
"**/@theia/markers": "0.14.0",
"**/@theia/navigator": "0.14.0",
"**/@theia/outline-view": "0.14.0",
"**/@theia/output": "0.14.0",
"**/@theia/userstorage": "0.14.0",
"**/@theia/variable-resolver": "0.14.0",
"**/@theia/workspace": "0.14.0",
"**/@theia/java": "0.14.0",
"**/@theia/java-debug": "0.14.0",
"**/@theia/terminal": "0.14.0",
"**/@theia/console": "0.14.0",
"**/@theia/preferences": "0.14.0",
"**/@theia/core": "0.14.0",
"**/sprotty": "0.8.0-next.15163a3",
"**/sprotty-theia": "0.8.0-next.a3b3621",
"**/@eclipse-glsp/client": "0.8.0-next.21e2732",
"**/@eclipse-glsp/theia-integration": "0.8.0-next.6b31143"
"**/@theia/editor": "1.0.0",
"**/@theia/filesystem": "1.0.0",
"**/@theia/languages": "1.0.0",
"**/@theia/monaco": "1.0.0",
"**/@theia/process": "1.0.0",
"**/@theia/application-manager": "1.0.0",
"**/@theia/application-package": "1.0.0",
"**/@theia/callhierarchy": "1.0.0",
"**/@theia/json": "1.0.0",
"**/@theia/markers": "1.0.0",
"**/@theia/navigator": "1.0.0",
"**/@theia/outline-view": "1.0.0",
"**/@theia/output": "1.0.0",
"**/@theia/userstorage": "1.0.0",
"**/@theia/variable-resolver": "1.0.0",
"**/@theia/workspace": "1.0.0",
"**/@theia/terminal": "1.0.0",
"**/@theia/console": "1.0.0",
"**/@theia/preferences": "1.0.0",
"**/@theia/core": "1.0.0",
"**/@theia/messages": "1.0.0",
"**/sprotty": "0.9.0-next.feedfc8",
"**/sprotty-theia": "0.9.0-next.63d6de7",
"**/@eclipse-glsp/client": "0.8.0-next.a936491",
"**/@eclipse-glsp/theia-integration": "0.8.0-next.06f8d8d"
},
"workspaces": [
"theia-ecore",
Expand Down
14 changes: 9 additions & 5 deletions client/sprotty-ecore/css/diagram.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:root {
--sprotty-background: var(--theia-layout-color3);
--sprotty-edge: var(--theia-ui-font-color1);
--sprotty-border: var(--theia-border-color2);
--sprotty-edge: var(--theia-editor-foreground);
--sprotty-border: var(--theia-editor-foreground);
}

svg {
Expand All @@ -27,9 +27,13 @@ svg {
background: var(--sprotty-background);
}

.sprotty-graph .sprotty-node {
fill: inherit;
}

.ecore-node {
fill: #fffcdf;
stroke: black;
stroke: var(--sprotty-border);
stroke-width: 1;
font-weight: bold;
filter: url(#dropShadow);
Expand Down Expand Up @@ -73,7 +77,7 @@ svg {
line-height: 3px;
font-weight: normal;
text-align: left;
stroke: #000;
stroke: var(--sprotty-border);
stroke-width: 2px;
}

Expand Down Expand Up @@ -164,7 +168,7 @@ svg {
}

.ecore-edge>.triangle.inheritance {
fill: var(--sprotty-background);
fill: white;
}

.ecore-edge.aggregation .ecore-edge.composition {
Expand Down
21 changes: 13 additions & 8 deletions client/sprotty-ecore/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
GLSPGraph,
glspMouseToolModule,
glspSelectModule,
hoverModule,
HtmlRoot,
HtmlRootView,
labelEditModule,
Expand Down Expand Up @@ -59,11 +58,16 @@ import {
TYPES,
validationModule,
viewportModule,
zorderModule
zorderModule,
glspHoverModule,
toolsModule,
glspServerCopyPasteModule,
glspContextMenuModule,
copyPasteContextMenuModule
} from "@eclipse-glsp/client/lib";
import executeCommandModule from "@eclipse-glsp/client/lib/features/execute/di.config";
import { Container, ContainerModule } from "inversify";
import { EditLabelUI } from "sprotty/lib";
import { EditLabelUI, contextMenuModule } from "sprotty/lib";

import { EditLabelUIAutocomplete } from "./features/edit-label-autocomplete";
import { LabelSelectionFeedback } from "./feedback";
Expand Down Expand Up @@ -137,11 +141,12 @@ export default (containerId: string) => {
});

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

return container;

};
7 changes: 5 additions & 2 deletions client/sprotty-ecore/src/features/edit-label-autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ export class EditLabelUIAutocomplete extends EditLabelUI {
super.initializeContents(containerElement);
}

protected handleKeyDown(event: KeyboardEvent) {
super.handleKeyDown(event);
protected configureAndAdd(element: HTMLElement, containerElement: HTMLElement) {
super.configureAndAdd(element, containerElement);
element.addEventListener('keydown', event => this.handleKeyDown(event));
}

protected handleKeyDown(event: KeyboardEvent) {
if (matchesKeystroke(event, 'Space', 'ctrl')) {
this.showAutocomplete = true;
if (this.isAutoCompleteEnabled()) {
Expand Down
4 changes: 2 additions & 2 deletions client/theia-ecore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"url": "https://github.com/eclipsesource/ecore-glsp.git"
},
"dependencies": {
"@eclipse-glsp/theia-integration": "next",
"@theia/core": "latest",
"sprotty-ecore": "0.2.0",
"@eclipse-glsp/theia-integration": "next"
"sprotty-ecore": "0.2.0"
},
"devDependencies": {
"rimraf": "latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR MIT
********************************************************************************/
import { registerDefaultTools, TYPES } from "@eclipse-glsp/client/lib";
import { TYPES } from "@eclipse-glsp/client/lib";
import { SelectionService } from "@theia/core";
import { Container, inject, injectable } from "inversify";
import { createEcoreDiagramContainer } from "sprotty-ecore/lib";
Expand All @@ -30,7 +30,6 @@ export class EcoreDiagramConfiguration implements DiagramConfiguration {
container.bind(TYPES.IActionHandlerInitializer).to(TheiaSprottySelectionForwarder);
container.bind(SelectionService).toConstantValue(this.selectionService);

registerDefaultTools(container);
return container;
}
}
16 changes: 9 additions & 7 deletions client/theia-ecore/src/browser/diagram/ecore-diagram-manager..ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
*
* SPDX-License-Identifier: EPL-2.0 OR MIT
********************************************************************************/
import { RequestOperationsAction, RequestTypeHintsAction } from "@eclipse-glsp/client/lib";
import { RequestTypeHintsAction, EnableToolPaletteAction } from "@eclipse-glsp/client";
import {
GLSPDiagramManager,
GLSPDiagramWidget,
GLSPTheiaSprottyConnector,
GLSPTheiaDiagramServer,
GLSPTheiaSprottyConnector
GLSPNotificationManager
} from "@eclipse-glsp/theia-integration/lib/browser";
import { MessageService } from "@theia/core";
import { WidgetManager } from "@theia/core/lib/browser";
import { EditorManager } from "@theia/editor/lib/browser";
import { inject, injectable } from "inversify";
import { DiagramServer, ModelSource, RequestModelAction, TYPES } from "sprotty";
import { DiagramWidget, DiagramWidgetOptions, TheiaFileSaver } from "sprotty-theia/lib";
import { DiagramWidget, DiagramWidgetOptions, TheiaFileSaver } from "sprotty-theia";

import { EcoreLanguage } from "../../common/ecore-language";
import { EcoreGLSPDiagramClient } from "./ecore-glsp-diagram-client";
Expand Down Expand Up @@ -49,9 +50,11 @@ export class EcoreDiagramManager extends GLSPDiagramManager {
@inject(TheiaFileSaver) fileSaver: TheiaFileSaver,
@inject(WidgetManager) widgetManager: WidgetManager,
@inject(EditorManager) editorManager: EditorManager,
@inject(MessageService) messageService: MessageService) {
@inject(MessageService) messageService: MessageService,
@inject(GLSPNotificationManager) notificationManager: GLSPNotificationManager) {
super();
this._diagramConnector = new GLSPTheiaSprottyConnector({ diagramClient, fileSaver, editorManager, widgetManager, diagramManager: this, messageService });
this._diagramConnector = new GLSPTheiaSprottyConnector({ diagramClient,
fileSaver, editorManager, widgetManager, diagramManager: this, messageService, notificationManager });
}

get fileExtensions() {
Expand Down Expand Up @@ -79,8 +82,7 @@ export class EcoreDiagramWidget extends GLSPDiagramWidget {
needsClientLayout: `${this.viewerOptions.needsClientLayout}`,
...this.options
}));
this.actionDispatcher.dispatch(new RequestOperationsAction());
this.actionDispatcher.dispatch(new RequestTypeHintsAction(this.options.diagramType));
// this.actionDispatcher.dispatch(new LayoutAction());
this.actionDispatcher.dispatch(new EnableToolPaletteAction());
}
}
Loading

0 comments on commit de808d7

Please sign in to comment.