diff --git a/TaskAndTimeTimJahn.txt b/TaskAndTimeTimJahn.txt index aea00bea96ac164b72b6dc809ca1b45c95b603ec..28302521f9732dc21448d493cbac2afcb95483c6 100644 --- a/TaskAndTimeTimJahn.txt +++ b/TaskAndTimeTimJahn.txt @@ -56,6 +56,7 @@ hours: 12.01.25 12h - 19.01.25 4h 26.01.25 8h +27.01.25 2h //------------------------------------------------------------------------------------------------------ see https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisite_native_keymap @@ -174,7 +175,21 @@ some unclear aspects regarding the issues: prio 1,3,4,6 -push to devel, merge with sebastioan as assignee in gitlab website +#8, #9 pages > node-pages > pages, server-pages + - node pages should be able to contain pages and server pages, just not node pages + - pages inside nodepages may also not contain further node pages + +further things: + - order arcs + references: + - see views.tsx line 40 -> needs to be at another position probably to always work + - https://github.com/eclipse-sprotty/sprotty/issues/94 + + +next meeting: 3.2.25 + +-------------------------------------------------------------------------------------------- + +push to devel, merge with sebastian as assignee in gitlab website 30.11.24 8h 01.12.24 8h 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 232ae883637c3ba6adbc416a46d4d8d0b0901179..81393267ceeef557cbd4707ed4960a35321147bd 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 { isTransition, EditInputSignalMenu, isRefTransition } from 'tasklist-glsp'; +import { isTransition, EditInputSignalMenu} from 'tasklist-glsp'; export namespace EditInputSignalsMenuCommand { export const EDIT_INPUT_SIGNALS_MENU = 'edit-input-signals-menu-command'; @@ -37,14 +37,8 @@ export class EditInputSignalsMenuCommandContribution implements CommandContribut visible: true }) ], - isEnabled: context => !context.isReadonly && ( - context.selectedElements.filter(isTransition).length === 1 || - context.selectedElements.filter(isRefTransition).length === 1 - ), - isVisible: context => !context.isReadonly && ( - context.selectedElements.filter(isTransition).length === 1 || - context.selectedElements.filter(isRefTransition).length === 1 - ) + isEnabled: context => !context.isReadonly && context.selectedElements.filter(isTransition).length === 1, + isVisible: 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 a64f27aa952ec1905d85e2be1aca0aee65dd0206..c00b62a39596627401beb2dd0e7e4831e3e186cc 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 { isPlace, ResetMarkingsOperation, isRefPlace } from 'tasklist-glsp'; +import { isPlace, ResetMarkingsOperation} from 'tasklist-glsp'; export namespace ResetMarkingsCommand { export const RESET_MARKINGS = 'reset-markings-command'; @@ -31,14 +31,8 @@ export class ResetMarkingsCommandContribution implements CommandContribution { { id: ResetMarkingsCommand.RESET_MARKINGS, label: 'Reset Markings' }, new GLSPCommandHandler(this.shell, { actions: context => [ResetMarkingsOperation.create()], - isEnabled: context => !context.isReadonly && ( - context.selectedElements.filter(isPlace).length === 1 || - context.selectedElements.filter(isRefPlace).length == 1 - ), - isVisible: context => !context.isReadonly && ( - context.selectedElements.filter(isPlace).length === 1 || - context.selectedElements.filter(isRefPlace).length == 1 - ) + isEnabled: context => !context.isReadonly && context.selectedElements.filter(isPlace).length === 1, + isVisible: context => !context.isReadonly && context.selectedElements.filter(isPlace).length === 1 }) ); } diff --git a/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/DiNeROS/ElementCreation/CreateNodePageNodeHandler.java b/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/DiNeROS/ElementCreation/CreateNodePageNodeHandler.java index d17629187cc2798a11f40a8aefa9a279f1e1a8ba..ace87223b633d40350b52fa5509deb9cb5d997e8 100644 --- a/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/DiNeROS/ElementCreation/CreateNodePageNodeHandler.java +++ b/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/DiNeROS/ElementCreation/CreateNodePageNodeHandler.java @@ -54,6 +54,34 @@ public class CreateNodePageNodeHandler extends CreatePageHandler return Optional.of(pageCommand); } + @Override + protected EObject getParentElement(final GModelElement container) + { + // prevent node page as root page (should be normal page, not a node) + if(container.getType().equals(PNMLModelTypes.GRAPH)) + throw new IllegalCallerException("Node Page must be placed inside a Page."); + + //only basic page my be container for node page + if(!container.getType().equals(PNMLModelTypes.PAGE_NODE)) + throw new IllegalCallerException("Node Page should only be contained inside a (basic) Page."); + + // check if the new node page would be nested inside an existing node page (forbidden) + GModelElement temp = container; + while (temp != null) + { + String type = temp.getType(); + + if(type.equals(PNMLModelTypes.GRAPH)) + break; + + if(type.equals(PNMLModelTypes.NODE_PAGE_NODE)) + throw new IllegalCallerException("Node Pages may not in any way contain a Node Page."); + + temp = temp.getParent(); + } + return modelState.getIndex().getEObject(container.getId()).orElseThrow(); + } + protected ToolInfoPage createNodePageToolInfo (Page newPage) { ToolInfoPage toolSpecifics = PtnetFactory.eINSTANCE.createToolInfoPage(); diff --git a/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/NodeCreation/CreatePageHandler.java b/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/NodeCreation/CreatePageHandler.java index 87514af3cb5a756bbaa89a5ce4e251e48c6955c5..81750db496b3dc3a901e5e5567bfa2f650fb4466 100644 --- a/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/NodeCreation/CreatePageHandler.java +++ b/glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/handler/NodeCreation/CreatePageHandler.java @@ -63,25 +63,35 @@ public class CreatePageHandler extends AbstractCreateNodeHandler<CreateNodeOpera return Optional.of(pageCommand); } - protected EObject getParentElement(final GModelElement container) { - if(container.getType().equals(PNMLModelTypes.PAGE_NODE)){ //page is subpage of other page + protected EObject getParentElement(final GModelElement container) + { + String type = container.getType(); + + //page is subpage of other page or node page + if(type.equals(PNMLModelTypes.PAGE_NODE) || type.equals(PNMLModelTypes.NODE_PAGE_NODE)) return modelState.getIndex().getEObject(container.getId()).orElseThrow(); - } else if(container.getType().equals(PNMLModelTypes.GRAPH)){ //page is top level page + + //page is top level page + if(type.equals(PNMLModelTypes.GRAPH)) return modelState.getSemanticModel(pnml.class).orElseThrow() .getNet().stream().findFirst().orElseThrow(); - } else { - throw new IllegalArgumentException("Page must be placed in graph or other page."); - } + + throw new IllegalArgumentException("Page must be placed in graph or other page."); } - protected EReference getRelationshipLiteral(final GModelElement container) { - if(container.getType().equals(PNMLModelTypes.PAGE_NODE)){ //page is subpage of other page + protected EReference getRelationshipLiteral(final GModelElement container) + { + String type = container.getType(); + + //page is subpage of other page or node page + if(type.equals(PNMLModelTypes.PAGE_NODE) || type.equals(PNMLModelTypes.NODE_PAGE_NODE)) return PtnetPackage.Literals.PAGE__PAGE; - } else if(container.getType().equals(PNMLModelTypes.GRAPH)){ //page is top level page + + //page is top level page + if(type.equals(PNMLModelTypes.GRAPH)) return PtnetPackage.Literals.PETRI_NET__PAGE; - } else { - throw new IllegalArgumentException("Page must be placed in graph or other page."); - } + + throw new IllegalArgumentException("Page must be placed in graph or other page."); } protected void denySecondRootPage(final GModelElement container)