Skip to content

Commit

Permalink
[bug] 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 1, 2025
1 parent ca55a1d commit ee6db2e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.eclipse.sirius.components.core.api.IEditingContext;
import org.eclipse.sirius.components.core.api.IIdentityService;
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 @@ -56,13 +57,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 @@ -132,6 +136,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

0 comments on commit ee6db2e

Please sign in to comment.