use of org.obeonetwork.dsl.environment.NamespacesContainer in project InformationSystem by ObeoNetwork.
the class TypesServices method collectAllContainers.
private void collectAllContainers(Collection<? extends EObject> elements, Collection<ObeoDSMObject> containers) {
Collection<EObject> newContainers = new ArrayList<EObject>();
for (EObject element : elements) {
EObject container = element.eContainer();
if (container instanceof NamespacesContainer || container instanceof TypesDefinition) {
if (!containers.contains(container)) {
containers.add((ObeoDSMObject) container);
newContainers.add((EObject) container);
}
}
}
if (!newContainers.isEmpty()) {
collectAllContainers(newContainers, containers);
}
}
use of org.obeonetwork.dsl.environment.NamespacesContainer in project InformationSystem by ObeoNetwork.
the class BindingService method getAllStructuredTypes.
private Collection<StructuredType> getAllStructuredTypes(EObject any) {
// Collect all structured types
Collection<StructuredType> structuredTypes = new ArrayList<StructuredType>();
// First, get all semantic resources in session
Collection<Resource> semanticResources = getAllSemanticResourcesInSession(any);
for (Resource resource : semanticResources) {
TreeIterator<EObject> iterator = EcoreUtil.getAllContents(resource, true);
while (iterator.hasNext()) {
EObject eObject = (EObject) iterator.next();
if (eObject instanceof StructuredType) {
structuredTypes.add((StructuredType) eObject);
} else {
if (!(eObject instanceof TypesDefinition || eObject instanceof NamespacesContainer || isOverviewRootInstance(eObject))) {
iterator.prune();
}
}
}
}
return structuredTypes;
}
Aggregations