Skip to content

Commit dfc5059

Browse files
gcoutableAxelRICHARD
authored andcommitted
[2240] Update portion kind creation tool selection dialog
Bug: #2240 Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
1 parent d9aba9f commit dfc5059

8 files changed

Lines changed: 168 additions & 108 deletions

File tree

CHANGELOG.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
- https://github.com/eclipse-syson/syson/issues/2198[#2198] [diagrams] Improve diagram-to-diagram drag and drop to support dropping multiple graphical nodes at once, leveraging Sirius Web's `droppedNodes` and `droppedElements` variables.
2828
- https://github.com/eclipse-syson/syson/issues/2194[#2194] [diagrams] Properly report feedback messages to user when using _ISysMLMoveElementService_.
2929
- https://github.com/eclipse-syson/syson/issues/2182[#2182] [services] Provide a way for downstream applications to extend _ISysMLMoveElementService_;
30+
- https://github.com/eclipse-syson/syson/issues/2240[#2240] [diagrams] Update the choice of _timeslice_ and _snapshot_ elements that can be created in the selection dialog of tools creating _timeslice_ and _snapshot_ elements.
31+
Before, the selection dialog option with selection allowed choosing between all _timeslice/snapshot_ types.
32+
Now, the choice is restricted to the _timeslice/snapshot_ type that match the graphical node type on which the tool is applied.
3033

3134

3235
=== New features

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/general/view/GVTimesliceSnapshotNodeCreationTests.java

Lines changed: 128 additions & 12 deletions
Large diffs are not rendered by default.

backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/GeneralViewWithTopNodesTestProjectData.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public static class GraphicalIds {
3030

3131
public static final String ACTION_USAGE_ID = "61aaf64a-4fbc-356e-ba73-4bd47b386989";
3232

33+
public static final String ALLOCATION_USAGE_ID = "361506fb-2a1d-3edc-be2d-8cd60a235f53";
34+
3335
public static final String ATTRIBUTE_USAGE_ID = "7b8e6835-c563-35cd-8991-e2f894fc2139";
3436

3537
public static final String CONCERN_USAGE_ID = "0999b8c3-d37c-3644-a1d6-b9777a499d11";
@@ -38,16 +40,22 @@ public static class GraphicalIds {
3840

3941
public static final String ITEM_DEFINITION_ID = "df3542d9-6314-3da5-993c-a296f4042674";
4042

41-
public static final String PART_USAGE_ID = "4c4fe0d5-4974-377e-9113-9ab022c75f8c";
43+
public static final String ITEM_USAGE_ID = "78a84b8a-e91c-3338-b447-864793773dd9";
44+
45+
public static final String INTERFACE_USAGE_ID = "6bc0765c-4f9f-3a9e-ab45-3d717519535c";
4246

4347
public static final String PART_DEFINITION_ID = "fa617798-658e-3812-92f2-52e2fc39f851";
4448

4549
public static final String PART_DEFINITION_TEXTUAL_REP_ID = "3a992e49-95fa-384a-bb54-47284825bf17";
4650

47-
public static final String REQUIREMENT_USAGE_ID = "3eea9d01-7033-3f31-b7ef-561b5bc86d10";
51+
public static final String PART_USAGE_ID = "4c4fe0d5-4974-377e-9113-9ab022c75f8c";
52+
53+
public static final String OCCURRENCE_USAGE_ID = "47653014-87d1-3dc6-856b-72454aa93154";
4854

4955
public static final String REQUIREMENT_DEFINITION_ID = "b83f2b54-1602-382d-beb1-c500e08a8684";
5056

57+
public static final String REQUIREMENT_USAGE_ID = "3eea9d01-7033-3f31-b7ef-561b5bc86d10";
58+
5159
public static final String STATE_USAGE_ID = "1541c013-2cc7-3dd7-a39f-6e33d07b411e";
5260
}
5361

backend/services/syson-direct-edit-grammar/src/main/java/org/eclipse/syson/direct/edit/grammars/DirectEditLexer.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414
*******************************************************************************/
1515
package org.eclipse.syson.direct.edit.grammars;
1616

17-
import org.antlr.v4.runtime.CharStream;
1817
import org.antlr.v4.runtime.Lexer;
19-
import org.antlr.v4.runtime.RuntimeMetaData;
20-
import org.antlr.v4.runtime.Vocabulary;
21-
import org.antlr.v4.runtime.VocabularyImpl;
22-
import org.antlr.v4.runtime.atn.ATN;
23-
import org.antlr.v4.runtime.atn.ATNDeserializer;
24-
import org.antlr.v4.runtime.atn.LexerATNSimulator;
25-
import org.antlr.v4.runtime.atn.PredictionContextCache;
18+
import org.antlr.v4.runtime.CharStream;
19+
import org.antlr.v4.runtime.Token;
20+
import org.antlr.v4.runtime.TokenStream;
21+
import org.antlr.v4.runtime.*;
22+
import org.antlr.v4.runtime.atn.*;
2623
import org.antlr.v4.runtime.dfa.DFA;
24+
import org.antlr.v4.runtime.misc.*;
2725

2826
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"})
2927
public class DirectEditLexer extends Lexer {

backend/services/syson-direct-edit-grammar/src/main/java/org/eclipse/syson/direct/edit/grammars/DirectEditParser.java

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,14 @@
1414
*******************************************************************************/
1515
package org.eclipse.syson.direct.edit.grammars;
1616

17-
import java.util.List;
18-
19-
import org.antlr.v4.runtime.FailedPredicateException;
20-
import org.antlr.v4.runtime.NoViableAltException;
21-
import org.antlr.v4.runtime.Parser;
22-
import org.antlr.v4.runtime.ParserRuleContext;
23-
import org.antlr.v4.runtime.RecognitionException;
24-
import org.antlr.v4.runtime.RuleContext;
25-
import org.antlr.v4.runtime.RuntimeMetaData;
26-
import org.antlr.v4.runtime.Token;
27-
import org.antlr.v4.runtime.TokenStream;
28-
import org.antlr.v4.runtime.Vocabulary;
29-
import org.antlr.v4.runtime.VocabularyImpl;
30-
import org.antlr.v4.runtime.atn.ATN;
31-
import org.antlr.v4.runtime.atn.ATNDeserializer;
32-
import org.antlr.v4.runtime.atn.ParserATNSimulator;
33-
import org.antlr.v4.runtime.atn.PredictionContextCache;
17+
import org.antlr.v4.runtime.atn.*;
3418
import org.antlr.v4.runtime.dfa.DFA;
35-
import org.antlr.v4.runtime.tree.ParseTreeListener;
36-
import org.antlr.v4.runtime.tree.TerminalNode;
19+
import org.antlr.v4.runtime.*;
20+
import org.antlr.v4.runtime.misc.*;
21+
import org.antlr.v4.runtime.tree.*;
22+
import java.util.List;
23+
import java.util.Iterator;
24+
import java.util.ArrayList;
3725

3826
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"})
3927
public class DirectEditParser extends Parser {

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageSnapshotNodeToolProvider.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
*******************************************************************************/
1313
package org.eclipse.syson.diagram.common.view.tools;
1414

15-
import java.util.List;
16-
import java.util.stream.Collectors;
17-
18-
import org.eclipse.emf.ecore.EClass;
1915
import org.eclipse.sirius.components.collaborative.diagrams.DiagramContext;
2016
import org.eclipse.sirius.components.core.api.IEditingContext;
2117
import org.eclipse.sirius.components.diagrams.Node;
@@ -33,7 +29,6 @@
3329
import org.eclipse.syson.sysml.SysmlPackage;
3430
import org.eclipse.syson.util.AQLConstants;
3531
import org.eclipse.syson.util.ServiceMethod;
36-
import org.eclipse.syson.util.SysMLMetamodelHelper;
3732

3833
/**
3934
* Used to create a snapshot in an in any subclass of {@link org.eclipse.syson.sysml.OccurrenceUsage}.
@@ -46,28 +41,6 @@
4641
*/
4742
public class OccurrenceUsageSnapshotNodeToolProvider implements INodeToolProvider {
4843

49-
private static final List<EClass> SUPPORTED_PORTION_KIND_ELEMENTS = List.of(
50-
SysmlPackage.eINSTANCE.getAcceptActionUsage(),
51-
SysmlPackage.eINSTANCE.getActionUsage(),
52-
SysmlPackage.eINSTANCE.getAllocationUsage(),
53-
SysmlPackage.eINSTANCE.getAssignmentActionUsage(),
54-
SysmlPackage.eINSTANCE.getCaseUsage(),
55-
SysmlPackage.eINSTANCE.getConcernUsage(),
56-
SysmlPackage.eINSTANCE.getConstraintUsage(),
57-
SysmlPackage.eINSTANCE.getExhibitStateUsage(),
58-
SysmlPackage.eINSTANCE.getInterfaceUsage(),
59-
SysmlPackage.eINSTANCE.getItemUsage(),
60-
SysmlPackage.eINSTANCE.getOccurrenceUsage(),
61-
SysmlPackage.eINSTANCE.getPartUsage(),
62-
SysmlPackage.eINSTANCE.getPerformActionUsage(),
63-
SysmlPackage.eINSTANCE.getPortUsage(),
64-
SysmlPackage.eINSTANCE.getRequirementUsage(),
65-
SysmlPackage.eINSTANCE.getSatisfyRequirementUsage(),
66-
SysmlPackage.eINSTANCE.getStateUsage(),
67-
SysmlPackage.eINSTANCE.getUseCaseUsage(),
68-
SysmlPackage.eINSTANCE.getViewUsage()
69-
);
70-
7144
private final DiagramBuilders diagramBuilderHelper = new DiagramBuilders();
7245

7346
private final ViewBuilders viewBuilderHelper = new ViewBuilders();
@@ -130,9 +103,8 @@ private DialogDescription getDescriptionDialog() {
130103
}
131104

132105
private SelectionDialogTreeDescription getDialogTreeDescriptionDialog() {
133-
String elementsExpression = SUPPORTED_PORTION_KIND_ELEMENTS.stream().map(SysMLMetamodelHelper::buildQualifiedName).collect(Collectors.joining(",", "aql:Sequence{", "}"));
134106
return this.diagramBuilderHelper.newSelectionDialogTreeDescription()
135-
.elementsExpression(elementsExpression)
107+
.elementsExpression(AQLConstants.AQL_SELF + ".eClass()")
136108
.isSelectableExpression(AQLConstants.AQL_TRUE)
137109
.build();
138110
}

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/tools/OccurrenceUsageTimesliceNodeToolProvider.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
*******************************************************************************/
1313
package org.eclipse.syson.diagram.common.view.tools;
1414

15-
import java.util.List;
16-
import java.util.stream.Collectors;
17-
18-
import org.eclipse.emf.ecore.EClass;
1915
import org.eclipse.sirius.components.collaborative.diagrams.DiagramContext;
2016
import org.eclipse.sirius.components.core.api.IEditingContext;
2117
import org.eclipse.sirius.components.diagrams.Node;
@@ -34,7 +30,6 @@
3430
import org.eclipse.syson.sysml.SysmlPackage;
3531
import org.eclipse.syson.util.AQLConstants;
3632
import org.eclipse.syson.util.ServiceMethod;
37-
import org.eclipse.syson.util.SysMLMetamodelHelper;
3833

3934
/**
4035
* Used to create a time slice in any subclass of {@link org.eclipse.syson.sysml.OccurrenceUsage}.
@@ -47,28 +42,6 @@
4742
*/
4843
public class OccurrenceUsageTimesliceNodeToolProvider implements INodeToolProvider {
4944

50-
private static final List<EClass> SUPPORTED_PORTION_KIND_ELEMENTS = List.of(
51-
SysmlPackage.eINSTANCE.getAcceptActionUsage(),
52-
SysmlPackage.eINSTANCE.getActionUsage(),
53-
SysmlPackage.eINSTANCE.getAllocationUsage(),
54-
SysmlPackage.eINSTANCE.getAssignmentActionUsage(),
55-
SysmlPackage.eINSTANCE.getCaseUsage(),
56-
SysmlPackage.eINSTANCE.getConcernUsage(),
57-
SysmlPackage.eINSTANCE.getConstraintUsage(),
58-
SysmlPackage.eINSTANCE.getExhibitStateUsage(),
59-
SysmlPackage.eINSTANCE.getInterfaceUsage(),
60-
SysmlPackage.eINSTANCE.getItemUsage(),
61-
SysmlPackage.eINSTANCE.getOccurrenceUsage(),
62-
SysmlPackage.eINSTANCE.getPartUsage(),
63-
SysmlPackage.eINSTANCE.getPerformActionUsage(),
64-
SysmlPackage.eINSTANCE.getPortUsage(),
65-
SysmlPackage.eINSTANCE.getRequirementUsage(),
66-
SysmlPackage.eINSTANCE.getSatisfyRequirementUsage(),
67-
SysmlPackage.eINSTANCE.getStateUsage(),
68-
SysmlPackage.eINSTANCE.getUseCaseUsage(),
69-
SysmlPackage.eINSTANCE.getViewUsage()
70-
);
71-
7245
private final DiagramBuilders diagramBuilderHelper = new DiagramBuilders();
7346

7447
private final ViewBuilders viewBuilderHelper = new ViewBuilders();
@@ -131,9 +104,8 @@ private DialogDescription getDescriptionDialog() {
131104
}
132105

133106
private SelectionDialogTreeDescription getDialogTreeDescriptionDialog() {
134-
String elementsExpression = SUPPORTED_PORTION_KIND_ELEMENTS.stream().map(SysMLMetamodelHelper::buildQualifiedName).collect(Collectors.joining(",", "aql:Sequence{", "}"));
135107
return this.diagramBuilderHelper.newSelectionDialogTreeDescription()
136-
.elementsExpression(elementsExpression)
108+
.elementsExpression(AQLConstants.AQL_SELF + ".eClass()")
137109
.isSelectableExpression(AQLConstants.AQL_TRUE)
138110
.build();
139111
}

doc/content/modules/user-manual/pages/release-notes/2026.7.0.adoc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ image::release-notes-start-done-states.png[Tool to create a start and done, widt
2323
+
2424
image::release-notes-framed-concern-tool.png[Tool to create a _frame_ concern usage, width=60%,height=60%]
2525

26-
** Add the _frames_ compartment graphical node in `RequirementUsage` and `RequirementDefinition` graphical nodes.
26+
** Add the _frames_ compartment graphical node to `RequirementUsage` and `RequirementDefinition` graphical nodes.
2727
+
2828
image::release-notes-frames-compartment.png[frames compartment displaying concern usages of a requirement, width=40%,height=40%]
2929

@@ -32,7 +32,7 @@ image::release-notes-frames-compartment.png[frames compartment displaying concer
3232
* In the _Explorer_ view:
3333

3434
** The tree items corresponding to the internals of `Expression` elements (syntax tree) are now hidden by default.
35-
A new _Explorer_ view filter named _Hide expression internals_ allows to display them if needed.
35+
A new _Explorer_ view filter named _Hide expression internals_ allows displaying them if needed.
3636
+
3737
[cols="1,1"]
3838
|===
@@ -43,17 +43,17 @@ a|image::explorer-expression-internals-hidden.png[Internals hidden (default)]
4343
a|image::explorer-expression-internals-visible.png[Internals visible]
4444
|===
4545

46-
** The dialog creating a child element provide two more options for `RequirementUsage` or `RequirementDefinition` tree items.
47-
One creates a `ConcernUsage` and another one creates `FramedConcernMembership`.
48-
The one creating a `ConcernUsage` create a `FramedConcernMembership` as an intermediate container.
49-
The one creating a `FramedConcernMembership` only creates the membership.
50-
In both cases, to display the `FramedConcernMembership` deactivate the `Hide Memberships` filter.
46+
** The dialog creating a child element provides two more options for `RequirementUsage` or `RequirementDefinition` tree items.
47+
One creates a `ConcernUsage` and another one creates a `FramedConcernMembership`.
48+
The option that creates a `ConcernUsage` creates a `FramedConcernMembership` as an intermediate container.
49+
The option that creates a `FramedConcernMembership` only creates the membership.
50+
In both cases, to display the `FramedConcernMembership`, deactivate the `Hide Memberships` filter.
5151
** It is now possible to create, edit and delete _Expressions_ using their textual syntax from the _Explorer_ view.
5252
To _create_ an expression, invoke the _New expression_ context menu action on a compatible element (supported elements are `Attributes`, `Constraints` and `Transitions`).
5353
A modal will open where you can enter the textual representation of the expression to create.
5454
Click on the _Update_ button to validate.
55-
If the expression entered is valid, it will be created and the modal will be automatically close.
56-
If the expression entered is _not_ valid, the modal will be kept open and show the error(s) in an expandable accordion.
55+
If the entered expression is valid, it will be created and the modal will automatically close.
56+
If the entered expression is _not_ valid, the modal will remain open and show the error(s) in an expandable accordion.
5757
Fix any error reported before clicking on _Update_ again (or canceling the operation).
5858
+
5959
image::edit-expression-modal.png[Edit expression modal, width=80%]
@@ -78,6 +78,9 @@ Now, the label dynamically adapts based on whether the `ConcernUsage` or `Constr
7878
*** Elements having both a name and an owned reference subsetting now display using the standard subsetting notation (e.g., `ElementName ::> SubsettingName`).
7979
*** Elements without name and an owned reference subsetting display only the reference subsetting name
8080
*** Elements without reference subsetting display their name.
81+
** Update the choice of _timeslice_ and _snapshot_ elements that can be created in the selection dialog of tools creating _timeslice_ and _snapshot_ elements.
82+
Before, the selection dialog allowed choosing between all _timeslice_ and _snapshot_ types.
83+
Now, the choice is restricted to the _timeslice_ or _snapshot_ type that matches the graphical node type on which the tool is applied.
8184

8285
== Technical details
8386

0 commit comments

Comments
 (0)