Search in sources :

Example 1 with System

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

the class WireItemProvider method addSourcePropertyDescriptor.

/**
 * This adds a property descriptor for the Source feature.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
protected void addSourcePropertyDescriptor(Object object) {
    final System system = getContainingSystem((EObject) object);
    itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Wire_source_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Wire_source_feature", "_UI_Wire_type"), SoaPackage.Literals.WIRE__SOURCE, true, false, true, null, null, null) {

        public java.util.Collection<?> getChoiceOfValues(Object object) {
            Collection<Object> choiceOfValues = new ArrayList<Object>();
            List<org.obeonetwork.dsl.soa.Service> services = getRequiredServices(system);
            choiceOfValues.addAll(services);
            return choiceOfValues;
        }
    });
}
Also used : IItemPropertyDescriptor(org.eclipse.emf.edit.provider.IItemPropertyDescriptor) ItemPropertyDescriptor(org.eclipse.emf.edit.provider.ItemPropertyDescriptor) ComposeableAdapterFactory(org.eclipse.emf.edit.provider.ComposeableAdapterFactory) Collection(java.util.Collection) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) List(java.util.List) System(org.obeonetwork.dsl.soa.System)

Example 2 with System

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

the class WireItemProvider method addDestPropertyDescriptor.

/**
 * This adds a property descriptor for the Dest feature.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
protected void addDestPropertyDescriptor(Object object) {
    final System system = getContainingSystem((EObject) object);
    itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Wire_dest_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Wire_dest_feature", "_UI_Wire_type"), SoaPackage.Literals.WIRE__DEST, true, false, true, null, null, null) {

        public java.util.Collection<?> getChoiceOfValues(Object object) {
            Collection<Object> choiceOfValues = new ArrayList<Object>();
            List<org.obeonetwork.dsl.soa.Service> services = getProvidedServices(system);
            choiceOfValues.addAll(services);
            return choiceOfValues;
        }
    });
}
Also used : IItemPropertyDescriptor(org.eclipse.emf.edit.provider.IItemPropertyDescriptor) ItemPropertyDescriptor(org.eclipse.emf.edit.provider.ItemPropertyDescriptor) ComposeableAdapterFactory(org.eclipse.emf.edit.provider.ComposeableAdapterFactory) Collection(java.util.Collection) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) List(java.util.List) System(org.obeonetwork.dsl.soa.System)

Example 3 with System

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

the class SoaModelWizard method createInitialModel.

/**
 * Create a new model.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
protected EObject createInitialModel() {
    System rootObject = soaFactory.createSystem();
    rootObject.setCreatedOn(new Date());
    return rootObject;
}
Also used : System(org.obeonetwork.dsl.soa.System) Date(java.util.Date)

Example 4 with System

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

the class SoaMigrationHelper method postLoad.

@Override
public void postLoad(XMLResource resource, InputStream inputStream, Map<?, ?> options) {
    // Remove old DTO Registry level
    for (EObject rootObject : resource.getContents()) {
        if (rootObject instanceof System) {
            System system = (System) rootObject;
            if (system.getOwnedNamespaces().size() == 1) {
                Namespace oldDtoRegistry = system.getOwnedNamespaces().get(0);
                removeDtoRegistry(oldDtoRegistry);
            }
        }
    }
}
Also used : EObject(org.eclipse.emf.ecore.EObject) System(org.obeonetwork.dsl.soa.System) Namespace(org.obeonetwork.dsl.environment.Namespace)

Example 5 with System

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

the class SoaMigrationHelper method removeDtoRegistry.

private void removeDtoRegistry(Namespace dtoRegistry) {
    System system = (System) dtoRegistry.eContainer();
    if (!dtoRegistry.getOwnedNamespaces().isEmpty()) {
        // Store XMI IDs
        Map<EObject, String> eObjectToIds = new HashMap<EObject, String>();
        TreeIterator<EObject> eAllContents = dtoRegistry.eAllContents();
        while (eAllContents.hasNext()) {
            EObject child = eAllContents.next();
            String xmiId = child.eResource().getURIFragment(child);
            eObjectToIds.put(child, xmiId);
        }
        // Change parent of children
        Collection<Namespace> children = new ArrayList<Namespace>(dtoRegistry.getOwnedNamespaces());
        for (Namespace child : children) {
            system.getOwnedNamespaces().add(child);
        }
        // Restore XMI IDs
        for (Entry<EObject, String> eObjectToIdEntry : eObjectToIds.entrySet()) {
            EObject object = eObjectToIdEntry.getKey();
            String id = eObjectToIdEntry.getValue();
            ((XMLResource) object.eResource()).setID(object, id);
        }
    }
    // Delete old DTO registry
    EcoreUtil.delete(dtoRegistry, false);
}
Also used : HashMap(java.util.HashMap) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) System(org.obeonetwork.dsl.soa.System) Namespace(org.obeonetwork.dsl.environment.Namespace) XMLResource(org.eclipse.emf.ecore.xmi.XMLResource)

Aggregations

System (org.obeonetwork.dsl.soa.System)7 EObject (org.eclipse.emf.ecore.EObject)5 ArrayList (java.util.ArrayList)4 Collection (java.util.Collection)2 List (java.util.List)2 ComposeableAdapterFactory (org.eclipse.emf.edit.provider.ComposeableAdapterFactory)2 IItemPropertyDescriptor (org.eclipse.emf.edit.provider.IItemPropertyDescriptor)2 ItemPropertyDescriptor (org.eclipse.emf.edit.provider.ItemPropertyDescriptor)2 Namespace (org.obeonetwork.dsl.environment.Namespace)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 XMLResource (org.eclipse.emf.ecore.xmi.XMLResource)1 Component (org.obeonetwork.dsl.soa.Component)1 SystemPropertiesEditionPart (org.obeonetwork.dsl.soa.parts.SystemPropertiesEditionPart)1