Skip to content

[2467] Add connected elements tool to the General View - #2496

Open
AxelRICHARD wants to merge 1 commit into
cooldownfrom
cbr/enh/addreferenced
Open

[2467] Add connected elements tool to the General View#2496
AxelRICHARD wants to merge 1 commit into
cooldownfrom
cbr/enh/addreferenced

Conversation

@AxelRICHARD

@AxelRICHARD AxelRICHARD commented Aug 31, 2026

Copy link
Copy Markdown
Member

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

  • Have you reviewed this PR? Please do a first quick review, It is very useful to detect typos and missing copyrights, check comments, check your code... The reviewer will thank you for that :)

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the priority: and pr: labels been added to the pull request? (In case of doubt, start with the labels priority: low and pr: to review later)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (area:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

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>
@cbrun
cbrun force-pushed the cbr/enh/addreferenced branch from 51dcaf9 to f4d7a9c Compare September 1, 2026 13:18
/**
* Tests for {@link DiagramMutationExposeService}.
*
* @author arichard

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@author cbrun

return element;
}

/** Adds every project element connected to the given element to the current view. */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add full javadoc

return element;
}

private Set<Element> getConnectedElements(Element element, ResourceSet resourceSet) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add full javadoc here and on every new method you introduced

return resource != null && resourceSet.getResources().contains(resource) && !ElementUtil.isStandardLibraryResource(resource);
}

private EdgeEndpoints getGeneralViewEdgeEndpoints(Element candidate) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an EMF Switch in a dedicated class would be more suitable

}

/**
* Create a {@link NodeToolSection} containing the {@code Add Existing Elements} tools.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the javadoc

.build();
var builder = this.diagramBuilderHelper.newNodeToolSection().name("Related Elements");
if (nested) {
builder.nodeTools(this.addExistingElementsTool(false, true), this.addExistingElementsTool(true, true), this.addExistingConnectedElementsTool());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you add your tool only if nested is true?

public NodeToolSection relatedElementsGroupToolSection() {
return this.diagramBuilderHelper.newNodeToolSection()
.name("Related Elements")
.nodeTools(this.addExistingElementsGroupTool(false), this.addExistingElementsGroupTool(true))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add it here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add existing connected elements to a General View

2 participants