Skip to content

Commit

Permalink
eclipse-capella#2884 Improve DnD on DeploymentLinks
Browse files Browse the repository at this point in the history
When multiple DeploymentsLinks are enabled, the drag and drop of a
Component or a Part with several DeploymentLinks doesn't remove existing
DeploymentsLinks that are not affected by the reference update.

Signed-off-by: Glenn Plouhinec <[email protected]>
  • Loading branch information
GlennPlou committed Jul 9, 2024
1 parent 1606d6a commit ad8a912
Show file tree
Hide file tree
Showing 3 changed files with 5,667 additions and 5,655 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2020 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2024 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -727,6 +727,11 @@ public boolean isValidDndABComponent(Part semanticObjectToDrop, EObject targetCo
}

context = CsServices.getService().getABTarget((DSemanticDecorator) targetContainerView);
final EObject semanticTarget = context;
boolean isSourceAlreadyReployed = semanticObjectToDrop.getDeployingLinks().stream().anyMatch(link -> link.eContainer().equals(semanticTarget));
if (isSourceAlreadyReployed) {
return false;
}
if (context instanceof BlockArchitecture) {
return false;

Expand Down
Loading

0 comments on commit ad8a912

Please sign in to comment.