-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2159] Change Capella Migration due to Sirius uid support
Bug: 2159 Change-Id: I09e4e74f2e7f416c4649d984c7f714205fa7f145 Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com>
- Loading branch information
Showing
3 changed files
with
84 additions
and
58 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
38 changes: 38 additions & 0 deletions
38
...l.handler/src/org/polarsys/capella/core/model/handler/helpers/SemanticResourcesScope.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,38 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2018 THALES GLOBAL SERVICES. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.core.model.handler.helpers; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import org.eclipse.emf.ecore.resource.Resource; | ||
import org.eclipse.emf.ecore.resource.ResourceSet; | ||
import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; | ||
import org.polarsys.capella.shared.id.handler.IScope; | ||
|
||
/** | ||
* A scope browsing only semantic resources on the given resource set | ||
*/ | ||
public class SemanticResourcesScope implements IScope { | ||
|
||
private ResourceSet _set; | ||
|
||
public SemanticResourcesScope(ResourceSet set) { | ||
_set = set; | ||
} | ||
|
||
@Override | ||
public List<Resource> getResources() { | ||
return _set.getResources().stream().filter(x -> CapellaResourceHelper.isCapellaResource(x)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
} |