Skip to content

Commit

Permalink
[1077] Fix explorer in case of non-sysml domain
Browse files Browse the repository at this point in the history
Fix behavior of hasChildren management of syson explorer when handling model elements from non-sysml domains. It now falls back to SiriusWeb implementation when necessary.

Signed-off-by: Didier Vojtisek <[email protected]>
  • Loading branch information
dvojtise committed Mar 4, 2025
1 parent 3a0e527 commit 5210b43
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

=== Bug fixes

- https://github.com/eclipse-syson/syson/issues/1077[#1077] [explorer] Fix navigation in case of project containing both sysml and non-sysml model elements

=== Improvements

- https://github.com/eclipse-syson/syson/issues/1061[#1061] [general-view] Add ellipsis on `Packages` label, to provide visual feedback on name overflow.
Expand Down Expand Up @@ -63,6 +65,7 @@ Export to textual SysMLv2 is not fully implemented yet so there are still unhand
- https://github.com/eclipse-syson/syson/issues/1020[#1020] [general-view] The multiplicity should not be displayed on edges.
- https://github.com/eclipse-syson/syson/issues/1009[#1009] [metamodel] Fix an issue where the diagram direct edit on graphical nodes could raise a backend error on unsettable enum attributes.
- https://github.com/eclipse-syson/syson/issues/1052[#1052] [general-view] Fix an issue where the execution of "New Port In/Inout/Out" tools was failing.
- https://github.com/eclipse-syson/syson/issues/1077[#1077] [explorer] Fix navigation in case of project containing both sysml and non-sysml model elements

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.sirius.components.core.api.IIdentityService;
import org.eclipse.sirius.web.application.UUIDParser;
import org.eclipse.sirius.web.application.editingcontext.EditingContext;
import org.eclipse.sirius.web.application.views.explorer.services.ExplorerServices;
import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerServices;
import org.eclipse.sirius.web.domain.boundedcontexts.representationdata.services.api.IRepresentationMetadataSearchService;
import org.eclipse.syson.services.UtilService;
Expand Down Expand Up @@ -57,13 +58,16 @@ public class SysONDefaultExplorerServices implements ISysONDefaultExplorerServic

private final UtilService utilService = new UtilService();

private final ExplorerServices siriuswebExplorerService;

public SysONDefaultExplorerServices(IIdentityService identityService, IContentService contentService, IRepresentationMetadataSearchService representationMetadataSearchService, IExplorerServices explorerServices,
ISysONExplorerFilterService filterService) {
ISysONExplorerFilterService filterService, ExplorerServices siriuswebExplorerService) {
this.identityService = Objects.requireNonNull(identityService);
this.contentService = Objects.requireNonNull(contentService);
this.representationMetadataSearchService = Objects.requireNonNull(representationMetadataSearchService);
this.explorerServices = Objects.requireNonNull(explorerServices);
this.filterService = Objects.requireNonNull(filterService);
this.siriuswebExplorerService = Objects.requireNonNull(siriuswebExplorerService);
}

@Override
Expand Down Expand Up @@ -133,6 +137,8 @@ public boolean hasChildren(Object self, IEditingContext editingContext, List<Str
List<Object> contents = this.filterService.applyFilters(this.contentService.getContents(self), activeFilterIds);
hasChildren = !contents.isEmpty() && contents.stream().anyMatch(e -> !(e instanceof EAnnotation))
|| this.hasRepresentation(element, editingContext);
} else {
siriuswebExplorerService.hasChildren(self, editingContext);
}
return hasChildren;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

== Bug fixes

- In `Explorer View`, the fold/unfold arrow is now also available for non-sysml model elements.

== New features

== Improvements
Expand Down

0 comments on commit 5210b43

Please sign in to comment.