Search in sources :

Example 1 with Wire

use of org.obeonetwork.dsl.soa.Wire 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);
}
Also used : ArrayList(java.util.ArrayList) Component(org.obeonetwork.dsl.soa.Component) Wire(org.obeonetwork.dsl.soa.Wire) HashSet(java.util.HashSet)

Example 2 with Wire

use of org.obeonetwork.dsl.soa.Wire in project InformationSystem by ObeoNetwork.

the class WireWirePropertiesEditionComponent 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 Wire wire = (Wire) elt;
        final WirePropertiesEditionPart wirePart = (WirePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(SoaViewsRepository.Wire.Properties.source)) {
            // init part
            sourceSettings = new EObjectFlatComboSettings(wire, SoaPackage.eINSTANCE.getWire_Source());
            wirePart.initSource(sourceSettings);
            // set the button mode
            wirePart.setSourceButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Wire.Properties.dest)) {
            // init part
            destSettings = new EObjectFlatComboSettings(wire, SoaPackage.eINSTANCE.getWire_Dest());
            wirePart.initDest(destSettings);
            // set the button mode
            wirePart.setDestButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Wire.Properties.description))
            wirePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, wire.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : WirePropertiesEditionPart(org.obeonetwork.dsl.soa.parts.WirePropertiesEditionPart) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) Wire(org.obeonetwork.dsl.soa.Wire)

Aggregations

Wire (org.obeonetwork.dsl.soa.Wire)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Component (org.obeonetwork.dsl.soa.Component)1 WirePropertiesEditionPart (org.obeonetwork.dsl.soa.parts.WirePropertiesEditionPart)1