[2467] Add connected elements tool to the General View - #2496
[2467] Add connected elements tool to the General View#2496AxelRICHARD wants to merge 3 commits into
Conversation
125ecbf to
51dcaf9
Compare
Expose existing elements connected to the selected element through both inbound and outbound General View relationships. Add the tool icon and integration coverage. Bug: #2467 Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
51dcaf9 to
f4d7a9c
Compare
| /** | ||
| * Tests for {@link DiagramMutationExposeService}. | ||
| * | ||
| * @author arichard |
There was a problem hiding this comment.
Fixed: changed the author to cbrun.
| return element; | ||
| } | ||
|
|
||
| /** Adds every project element connected to the given element to the current view. */ |
There was a problem hiding this comment.
Please add full javadoc
There was a problem hiding this comment.
Added full Javadoc, including the parameters and return value, and updated it to reflect the selection-based filtering.
| return element; | ||
| } | ||
|
|
||
| private Set<Element> getConnectedElements(Element element, ResourceSet resourceSet) { |
There was a problem hiding this comment.
please add full javadoc here and on every new method you introduced
There was a problem hiding this comment.
Added Javadoc to the helper methods introduced here, documenting connected-element discovery, project-resource filtering, parameters and return values.
| return resource != null && resourceSet.getResources().contains(resource) && !ElementUtil.isStandardLibraryResource(resource); | ||
| } | ||
|
|
||
| private EdgeEndpoints getGeneralViewEdgeEndpoints(Element candidate) { |
There was a problem hiding this comment.
I think an EMF Switch in a dedicated class would be more suitable
There was a problem hiding this comment.
Agreed. I extracted the endpoint resolution into GeneralViewEdgeEndpointsSwitch, extending SysmlSwitch, with dedicated tests.
There was a problem hiding this comment.
please update the javadoc
There was a problem hiding this comment.
Updated the Javadoc to include the connected-elements tool, for both the single-selection and multi-selection sections.
| .build(); | ||
| var builder = this.diagramBuilderHelper.newNodeToolSection().name("Related Elements"); | ||
| if (nested) { | ||
| builder.nodeTools(this.addExistingElementsTool(false, true), this.addExistingElementsTool(true, true), this.addExistingConnectedElementsTool()); |
There was a problem hiding this comment.
why do you add your tool only if nested is true?
There was a problem hiding this comment.
You're right, that restriction was unnecessary. The tool is now included for both values of nested, making it available from compartments as well.
There was a problem hiding this comment.
No need to add it here?
There was a problem hiding this comment.
Added it to the multi-selection section too. The operation collects connected candidates for the whole selection and filters them before exposing anything, so the result does not depend on selection order.
Extract edge endpoint resolution into an EMF switch and document the new methods. Enable the tool for compartments and multiple selections. Bug: #2467 Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
172ea3d to
b9b655a
Compare
|
Following our discussion, the tool now excludes connected elements that can be represented as ports or inside a compartment/container of any selected node, even when the compartment is hidden. This uses the node descriptions rather than a blacklist of semantic types. Independent connected elements are still exposed, and existing representations are preserved. Added unit and integration coverage, including single and multiple selections. The local build passes, and all coverage thresholds are met. |
Filter candidates against all selected nodes before exposure, including hidden compartments and border node representations. Bug: #2467 Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
b9b655a to
82e117e
Compare
Expose existing elements connected to the selected element through both inbound and outbound General View relationships.
Add the tool icon and integration coverage.
Bug: #2467
PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW
Auto review
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,type:)Changelog and release notes
CHANGELOG.adoc+doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adocbeen updated to reference the relevant issues?CHANGELOG.adoc?CHANGELOG.adoc?doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Key highlightssection indoc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?Documentation
Tests