forked from eclipse-capella/capella
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eclipse-capella#2061 Correcting the behavior of DiagramServices
When DiagramServices tests an EdgeMapping for selection or visibility, the disconnect between EdgeMappingImpl and EdgeMappingWrapper is now managed, allowing easier integration of external features and plugins into Capella.
- Loading branch information
1 parent
8c7a8dc
commit fe4d18e
Showing
3 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ius.analysis/src/org/polarsys/capella/core/sirius/analysis/helpers/EdgeMappingHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 THALES GLOBAL SERVICES and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.core.sirius.analysis.helpers; | ||
|
||
import org.eclipse.sirius.diagram.description.IEdgeMapping; | ||
import org.eclipse.sirius.diagram.description.impl.EdgeMappingImportImpl; | ||
import org.eclipse.sirius.diagram.model.business.internal.description.spec.EdgeMappingImportWrapper; | ||
|
||
public class EdgeMappingHelper { | ||
|
||
public static IEdgeMapping unwrapEdgeMapping(IEdgeMapping edgeMapping) { | ||
if (edgeMapping instanceof EdgeMappingImportWrapper) { | ||
return unwrapEdgeMapping(((EdgeMappingImportWrapper) edgeMapping).getWrappedEdgeMappingImport()); | ||
} else if (edgeMapping instanceof EdgeMappingImportImpl) { | ||
return unwrapEdgeMapping(((EdgeMappingImportImpl) edgeMapping).getImportedMapping()); | ||
} | ||
return edgeMapping; | ||
} | ||
} |