Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] add ADR for the support of Edges as targets of single click tools
Bug: #1574 Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
- Loading branch information
1 parent
060532e
commit 22a313f
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
doc/adrs/086_allow_single_click_tools_to_be_executed_on_edges.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
= ADR-086 - Allow single click tools to be executed on edges | ||
|
||
== Context | ||
|
||
Today a single click tool can only be executed on Nodes. An enhancement could be to allow single click tools to also be executed on Edges as it is the case in Sirius Desktop. | ||
|
||
== Decision | ||
|
||
Single click tools can also be executed on Edges. | ||
|
||
=== Frontend | ||
|
||
In `DiagramRepresentation.types.ts`, a new interface named `DiagramElementDescription` will be introduced. | ||
`NodeDescription` (there is no `EdgeDescription` in this file) will implement it. | ||
The target descriptions of a `SingleClickOnDiagramElementTool` will be `DiagramElementDescription` instead of `NodeDescription`. | ||
|
||
[source,ts] | ||
---- | ||
export interface DiagramElementDescription { | ||
id: string; | ||
} | ||
export interface NodeDescription extends DiagramElementDescription { | ||
id: string; | ||
} | ||
export interface SingleClickOnDiagramElementTool extends Tool { | ||
appliesToDiagramRoot: boolean; | ||
selectionDescriptionId: string; | ||
targetDescriptions: DiagramElementDescription[]; | ||
} | ||
---- | ||
|
||
=== Backend | ||
|
||
==== sirius-components-collaborative-diagrams | ||
|
||
In `diagram.graphqls`, a new interface `DiagramElementDescription` will be introduced. `NodeDescription` and `EdgeDescription` will implement it. | ||
|
||
The target descriptions of a `SingleClickOnDiagramElementTool` will be `DiagramElementDescription` instead of `NodeDescription`. | ||
|
||
[source,graphql] | ||
---- | ||
interface DiagramElementDescription { | ||
id: ID! | ||
synchronizationPolicy: SynchronizationPolicy! | ||
} | ||
type NodeDescription implements DiagramElementDescription { | ||
id: ID! | ||
synchronizationPolicy: SynchronizationPolicy! | ||
borderNodeDescriptions: [NodeDescription!]! | ||
childNodeDescriptions: [NodeDescription!]! | ||
} | ||
type EdgeDescription implements DiagramElementDescription { | ||
id: ID! | ||
synchronizationPolicy: SynchronizationPolicy! | ||
sourceNodeDescriptions: [NodeDescription!]! | ||
targetNodeDescriptions: [NodeDescription!]! | ||
} | ||
type SingleClickOnDiagramElementTool implements Tool { | ||
id: ID! | ||
label: String! | ||
imageURL: String! | ||
appliesToDiagramRoot: Boolean! | ||
selectionDescriptionId: String | ||
targetDescriptions: [DiagramElementDescription!]! | ||
} | ||
---- | ||
|
||
In `InvokeSingleClickOnDiagramElementToolEventHandler.java`, the `executeTool` method shall handle edges in addition to nodes. | ||
|
||
==== sirius-components-diagrams | ||
|
||
A new interface named `IDiagramElementDescription.java` will be introduced. | ||
`NodeDescription.java` and `EdgeDescription.java` will implement it. | ||
|
||
[source,java] | ||
---- | ||
public interface IDiagramElementDescription { | ||
UUID getId(); | ||
} | ||
---- | ||
|
||
The target descriptions of `SingleClickOnDiagramElementTool.java` will be `DiagramElementDescription` instead of `NodeDescription`. | ||
|
||
==== sirius-components-view-emf | ||
|
||
`ViewDiagramDescriptionConverter.java` && `ViewToolSectionsProvider.java` will be updated to handle edges in addition to nodes. | ||
|
||
==== sirius-components-compatibility | ||
|
||
`CompatibilityToolSectionsProvider.java` && `ToolProvider.java` will be updated to handle edges in addition to nodes. | ||
|
||
== Status | ||
|
||
WIP |