Search in sources :

Example 6 with OperationInterface

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

the class EntryLevelSystemCallDialog method getOperationSignature.

private OperationSignature getOperationSignature(EntryLevelSystemCall element) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(OperationInterface.class);
    filter.add(OperationSignature.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, element.eResource().getResourceSet());
    dialog.setProvidedService(OperationSignature.class);
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        if (!(o instanceof OperationInterface))
            continue;
        OperationInterface oi = (OperationInterface) o;
        if (!element.getProvidedRole_EntryLevelSystemCall().getProvidedInterface__OperationProvidedRole().equals(oi))
            dialog.getTreeViewer().remove(o);
    }
    dialog.open();
    return (OperationSignature) dialog.getResult();
}
Also used : OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference) OperationInterface(org.palladiosimulator.pcm.repository.OperationInterface)

Example 7 with OperationInterface

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

the class AddOperationProvidedRole method execute.

@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
    OperationProvidedRole role = (OperationProvidedRole) parameters.get("instance");
    OperationInterface oInterface = getOperationInterface(role);
    role.setProvidedInterface__OperationProvidedRole(oInterface);
}
Also used : OperationProvidedRole(org.palladiosimulator.pcm.repository.OperationProvidedRole) OperationInterface(org.palladiosimulator.pcm.repository.OperationInterface)

Example 8 with OperationInterface

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

the class AddOperationProvidedRole method getOperationInterface.

private OperationInterface getOperationInterface(OperationProvidedRole role) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(OperationInterface.class);
    // Additional Child References
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    // Creating the dialog
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, role.eResource().getResourceSet());
    // Setting the needed object type
    dialog.setProvidedService(OperationInterface.class);
    dialog.open();
    return (OperationInterface) dialog.getResult();
}
Also used : PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference) OperationInterface(org.palladiosimulator.pcm.repository.OperationInterface)

Aggregations

OperationInterface (org.palladiosimulator.pcm.repository.OperationInterface)8 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 OperationRequiredRole (org.palladiosimulator.pcm.repository.OperationRequiredRole)3 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)3 HashMap (java.util.HashMap)1 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)1 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)1 OperationsTabItemProviderAdapterFactory (org.palladiosimulator.editors.commons.tabs.operations.OperationsTabItemProviderAdapterFactory)1 OperationsEditorSection (org.palladiosimulator.editors.sirius.repository.custom.properties.editorsections.OperationsEditorSection)1 BasicComponent (org.palladiosimulator.pcm.repository.BasicComponent)1 OperationProvidedRole (org.palladiosimulator.pcm.repository.OperationProvidedRole)1 ExternalCallAction (org.palladiosimulator.pcm.seff.ExternalCallAction)1 ResourceDemandingBehaviour (org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour)1 ServiceEffectSpecification (org.palladiosimulator.pcm.seff.ServiceEffectSpecification)1 PalladioItemProviderAdapterFactory (org.palladiosimulator.pcm.ui.provider.PalladioItemProviderAdapterFactory)1