Search in sources :

Example 6 with BasicComponent

use of org.palladiosimulator.pcm.repository.BasicComponent in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddSEFF method getSignature.

private Signature getSignature(ResourceDemandingSEFF seff) {
    // Filter list (Repository > Interface > Signature)
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(Interface.class);
    filter.add(Signature.class);
    // Additional Child References
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    // Creating the dialog
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, seff.eResource().getResourceSet());
    // Setting the needed object type
    dialog.setProvidedService(Signature.class);
    // Filter: Show only provided interfaces
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
        EList<ProvidedRole> providedRoles = parent.getProvidedRoles_InterfaceProvidingEntity();
        if (o instanceof Interface) {
            if (!isReferenced(providedRoles, (Interface) o)) {
                dialog.getTreeViewer().remove(o);
            }
        }
    }
    dialog.open();
    return (Signature) dialog.getResult();
}
Also used : OperationProvidedRole(org.palladiosimulator.pcm.repository.OperationProvidedRole) InfrastructureProvidedRole(org.palladiosimulator.pcm.repository.InfrastructureProvidedRole) ProvidedRole(org.palladiosimulator.pcm.repository.ProvidedRole) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) Signature(org.palladiosimulator.pcm.repository.Signature) ArrayList(java.util.ArrayList) BasicComponent(org.palladiosimulator.pcm.repository.BasicComponent) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference) Interface(org.palladiosimulator.pcm.repository.Interface)

Aggregations

BasicComponent (org.palladiosimulator.pcm.repository.BasicComponent)6 ArrayList (java.util.ArrayList)4 EObject (org.eclipse.emf.ecore.EObject)4 EReference (org.eclipse.emf.ecore.EReference)4 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)4 Interface (org.palladiosimulator.pcm.repository.Interface)3 OperationInterface (org.palladiosimulator.pcm.repository.OperationInterface)3 OperationProvidedRole (org.palladiosimulator.pcm.repository.OperationProvidedRole)3 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)3 ProvidedRole (org.palladiosimulator.pcm.repository.ProvidedRole)3 ServiceEffectSpecification (org.palladiosimulator.pcm.seff.ServiceEffectSpecification)3 RepositoryComponent (org.palladiosimulator.pcm.repository.RepositoryComponent)2 RequiredRole (org.palladiosimulator.pcm.repository.RequiredRole)2 EventGroup (org.palladiosimulator.pcm.repository.EventGroup)1 EventType (org.palladiosimulator.pcm.repository.EventType)1 InfrastructureInterface (org.palladiosimulator.pcm.repository.InfrastructureInterface)1 InfrastructureProvidedRole (org.palladiosimulator.pcm.repository.InfrastructureProvidedRole)1 InfrastructureRequiredRole (org.palladiosimulator.pcm.repository.InfrastructureRequiredRole)1 InfrastructureSignature (org.palladiosimulator.pcm.repository.InfrastructureSignature)1 OperationRequiredRole (org.palladiosimulator.pcm.repository.OperationRequiredRole)1