use of org.obeonetwork.dsl.environment.BindingRegistry in project InformationSystem by ObeoNetwork.
the class BindingService method getBindingRegistry.
public BindingRegistry getBindingRegistry(Namespace namespace) {
if (namespace.getBindingRegistries().isEmpty()) {
BindingRegistry bindingRegistry = EnvironmentFactory.eINSTANCE.createBindingRegistry();
namespace.getBindingRegistries().add(bindingRegistry);
namespace.eResource().getContents().add(bindingRegistry);
return bindingRegistry;
} else {
return namespace.getBindingRegistries().get(0);
}
}
use of org.obeonetwork.dsl.environment.BindingRegistry in project InformationSystem by ObeoNetwork.
the class CinematicBindingServices method getGlobalBindingRegistry.
private BindingRegistry getGlobalBindingRegistry(CinematicElement element) {
CinematicRoot root = getCinematicRoot(element);
if (root != null) {
if (root.getBindingRegistries().isEmpty()) {
BindingRegistry bindingRegistry = EnvironmentFactory.eINSTANCE.createBindingRegistry();
root.getBindingRegistries().add(bindingRegistry);
root.eResource().getContents().add(bindingRegistry);
return bindingRegistry;
} else {
return root.getBindingRegistries().get(0);
}
}
return null;
}
use of org.obeonetwork.dsl.environment.BindingRegistry in project InformationSystem by ObeoNetwork.
the class CinematicBindingServices method createCinematicBindingInfo.
public BindingInfo createCinematicBindingInfo(AbstractViewElement viewElement, EObject boundElement) {
if (boundElement instanceof BoundableElement) {
BoundableElement target = (BoundableElement) boundElement;
BindingRegistry bindingRegistry = getGlobalBindingRegistry(viewElement);
BindingInfo newBindingInfo = EnvironmentFactory.eINSTANCE.createBindingInfo();
newBindingInfo.setLeft(viewElement);
newBindingInfo.setRight(target);
bindingRegistry.getBindingInfos().add(newBindingInfo);
return newBindingInfo;
}
return null;
}
use of org.obeonetwork.dsl.environment.BindingRegistry in project InformationSystem by ObeoNetwork.
the class BindingService method getRelatedBindingInfos.
public Collection<BindingInfo> getRelatedBindingInfos(Namespace namespace) {
// Use of LinkedHashSet to keep order and avoid potential lock/unlock
// loops problems
Set<BindingInfo> results = new LinkedHashSet<BindingInfo>();
for (BindingRegistry bindingRegistry : namespace.getBindingRegistries()) {
results.addAll(bindingRegistry.getBindingInfos());
}
for (Type containedType : namespace.getTypes()) {
if (containedType instanceof StructuredType) {
StructuredType containedStructuredType = (StructuredType) containedType;
results.addAll(getRelatedBindingInfos(containedStructuredType));
}
}
return results;
}
Aggregations