use of org.obeonetwork.dsl.soa.Component in project InformationSystem by ObeoNetwork.
the class WireItemProvider method getRequiredServices.
/**
* Return the required services in a System.
* @param system
* @return requiredServices
* @generated NOT
* @added
*/
private List<Service> getRequiredServices(System system) {
List<Service> requiredServices = new ArrayList<Service>();
List<Component> ownedComponents = system.getOwnedComponents();
for (Component component : ownedComponents) {
requiredServices.addAll(component.getRequiredServices());
}
return requiredServices;
}
use of org.obeonetwork.dsl.soa.Component in project InformationSystem by ObeoNetwork.
the class ComponentComponentPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Component component = (Component) elt;
final ComponentPropertiesEditionPart componentPart = (ComponentPropertiesEditionPart) editingPart;
// init values
if (isAccessible(SoaViewsRepository.Component.Properties.name))
componentPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, component.getName()));
if (isAccessible(SoaViewsRepository.Component.Properties.description))
componentPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, component.getDescription()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.soa.Component in project InformationSystem by ObeoNetwork.
the class SOAService method allReferencedComponents.
public List<Component> allReferencedComponents(System context) {
List<Component> allReferencedComponents = new ArrayList<Component>();
List<Wire> ownedWires = context.getOwnedWires();
// Add Components parent of source and dest of westWire
for (Wire wire : ownedWires) {
Component componentSource = (Component) wire.getSource().eContainer();
allReferencedComponents.add(componentSource);
Component componentDest = (Component) wire.getDest().eContainer();
allReferencedComponents.add(componentDest);
}
Set<Component> componentsSet = new HashSet<Component>();
// Remove duplicates
componentsSet.addAll(allReferencedComponents);
return new ArrayList<Component>(componentsSet);
}
use of org.obeonetwork.dsl.soa.Component in project InformationSystem by ObeoNetwork.
the class SOAService method allSelectableExternalComponents.
public List<Component> allSelectableExternalComponents(System context, DSemanticDiagram semanticDiagram) {
List<Component> allNonReferencedExternalComponents = allNonReferencedExternalComponents(context);
List<Component> allComponentToRemove = new ArrayList<Component>();
// "DNodeContainer"
for (EObject obj : EcoreService.eContents(semanticDiagram, DNodeContainer.class)) {
// Retrieve and add the target of DNodeContainer type of Component
if (((DNodeContainer) obj).getTarget() instanceof Component) {
allComponentToRemove.add((Component) ((DNodeContainer) obj).getTarget());
}
}
allNonReferencedExternalComponents.removeAll(allComponentToRemove);
return allNonReferencedExternalComponents;
}
use of org.obeonetwork.dsl.soa.Component in project InformationSystem by ObeoNetwork.
the class SOAService method allSelectableExternalComponentsAndAncestors.
/**
* Return all selectable externable components and their ancestors
* @param semanticDiagram
* @return
*/
public List<EObject> allSelectableExternalComponentsAndAncestors(DSemanticDiagram semanticDiagram) {
Set<EObject> result = new HashSet<EObject>();
EObject rootObject = semanticDiagram.getTarget();
if (rootObject instanceof System) {
System system = (System) rootObject;
// retrieve all selectable external components
List<Component> components = allSelectableExternalComponents(system, semanticDiagram);
for (Component component : components) {
// retrieve ancestors of each component
result.addAll(getAncestorsAndSelf(component));
}
}
return new ArrayList<EObject>(result);
}
Aggregations