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

issue #8, #9 seem fixed; visibility of 'input signal'/'reset markings'...

issue #8, #9 seem fixed; visibility of 'input signal'/'reset markings' constrained to transitions/places - their reference versions do not show this option either; updated TaskAndTimeTimJahn.txt; remaining tasks: fixing order of elements in the diagram view - arcs and references should never be hidden by other elemnts, renaming files and related references from 'tasklist' to 'pnml'
parent fa47581f
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ hours: ...@@ -56,6 +56,7 @@ hours:
12.01.25 12h - 12.01.25 12h -
19.01.25 4h 19.01.25 4h
26.01.25 8h 26.01.25 8h
27.01.25 2h
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
see https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisite_native_keymap 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: ...@@ -174,7 +175,21 @@ some unclear aspects regarding the issues:
prio 1,3,4,6 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 30.11.24 8h
01.12.24 8h 01.12.24 8h
......
...@@ -18,7 +18,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra ...@@ -18,7 +18,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core'; import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core';
import { ApplicationShell } from '@theia/core/lib/browser'; import { ApplicationShell } from '@theia/core/lib/browser';
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import { isTransition, EditInputSignalMenu, isRefTransition } from 'tasklist-glsp'; import { isTransition, EditInputSignalMenu} from 'tasklist-glsp';
export namespace EditInputSignalsMenuCommand { export namespace EditInputSignalsMenuCommand {
export const EDIT_INPUT_SIGNALS_MENU = 'edit-input-signals-menu-command'; export const EDIT_INPUT_SIGNALS_MENU = 'edit-input-signals-menu-command';
...@@ -37,14 +37,8 @@ export class EditInputSignalsMenuCommandContribution implements CommandContribut ...@@ -37,14 +37,8 @@ export class EditInputSignalsMenuCommandContribution implements CommandContribut
visible: true visible: true
}) })
], ],
isEnabled: context => !context.isReadonly && ( isEnabled: context => !context.isReadonly && context.selectedElements.filter(isTransition).length === 1,
context.selectedElements.filter(isTransition).length === 1 || isVisible: 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
)
}) })
); );
} }
......
...@@ -17,7 +17,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra ...@@ -17,7 +17,7 @@ import { GLSPCommandHandler, GLSPContextMenu } from '@eclipse-glsp/theia-integra
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core'; import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core';
import { ApplicationShell } from '@theia/core/lib/browser'; import { ApplicationShell } from '@theia/core/lib/browser';
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import { isPlace, ResetMarkingsOperation, isRefPlace } from 'tasklist-glsp'; import { isPlace, ResetMarkingsOperation} from 'tasklist-glsp';
export namespace ResetMarkingsCommand { export namespace ResetMarkingsCommand {
export const RESET_MARKINGS = 'reset-markings-command'; export const RESET_MARKINGS = 'reset-markings-command';
...@@ -31,14 +31,8 @@ export class ResetMarkingsCommandContribution implements CommandContribution { ...@@ -31,14 +31,8 @@ export class ResetMarkingsCommandContribution implements CommandContribution {
{ id: ResetMarkingsCommand.RESET_MARKINGS, label: 'Reset Markings' }, { id: ResetMarkingsCommand.RESET_MARKINGS, label: 'Reset Markings' },
new GLSPCommandHandler(this.shell, { new GLSPCommandHandler(this.shell, {
actions: context => [ResetMarkingsOperation.create()], actions: context => [ResetMarkingsOperation.create()],
isEnabled: context => !context.isReadonly && ( isEnabled: context => !context.isReadonly && context.selectedElements.filter(isPlace).length === 1,
context.selectedElements.filter(isPlace).length === 1 || isVisible: 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
)
}) })
); );
} }
......
...@@ -54,6 +54,34 @@ public class CreateNodePageNodeHandler extends CreatePageHandler ...@@ -54,6 +54,34 @@ public class CreateNodePageNodeHandler extends CreatePageHandler
return Optional.of(pageCommand); 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) protected ToolInfoPage createNodePageToolInfo (Page newPage)
{ {
ToolInfoPage toolSpecifics = PtnetFactory.eINSTANCE.createToolInfoPage(); ToolInfoPage toolSpecifics = PtnetFactory.eINSTANCE.createToolInfoPage();
......
...@@ -63,26 +63,36 @@ public class CreatePageHandler extends AbstractCreateNodeHandler<CreateNodeOpera ...@@ -63,26 +63,36 @@ public class CreatePageHandler extends AbstractCreateNodeHandler<CreateNodeOpera
return Optional.of(pageCommand); return Optional.of(pageCommand);
} }
protected EObject getParentElement(final GModelElement container) { protected EObject getParentElement(final GModelElement container)
if(container.getType().equals(PNMLModelTypes.PAGE_NODE)){ //page is subpage of other page {
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(); 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() return modelState.getSemanticModel(pnml.class).orElseThrow()
.getNet().stream().findFirst().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) { protected EReference getRelationshipLiteral(final GModelElement container)
if(container.getType().equals(PNMLModelTypes.PAGE_NODE)){ //page is subpage of other page {
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; 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; 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) protected void denySecondRootPage(final GModelElement container)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment