Search in sources :

Example 21 with PalladioSelectEObjectDialog

use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddProcessingResourceSpecification method getResourceType.

private ProcessingResourceType getResourceType(final ProcessingResourceSpecification processingResourceSpecification) {
    // positive filter
    final ArrayList<Object> filterList = new ArrayList<Object>();
    // Set types to show and their super types
    filterList.add(ProcessingResourceType.class);
    filterList.add(ResourceRepository.class);
    final ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
    // set EReference that should be set (in this case: active resource type)
    additionalReferences.add(ResourceenvironmentPackage.eINSTANCE.getProcessingResourceSpecification_ActiveResourceType_ActiveResourceSpecification());
    final PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), filterList, additionalReferences, processingResourceSpecification.getResourceContainer_ProcessingResourceSpecification().eResource().getResourceSet());
    dialog.setProvidedService(ProcessingResourceType.class);
    dialog.open();
    if (dialog.getResult() == null || !(dialog.getResult() instanceof ProcessingResourceType)) {
        return null;
    }
    return (ProcessingResourceType) dialog.getResult();
}
Also used : PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) ProcessingResourceType(org.palladiosimulator.pcm.resourcetype.ProcessingResourceType) EReference(org.eclipse.emf.ecore.EReference)

Example 22 with PalladioSelectEObjectDialog

use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddCollectionIteratorAction method getParameter.

private Parameter getParameter(CollectionIteratorAction action, ServiceEffectSpecification seff) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(Interface.class);
    filter.add(Signature.class);
    filter.add(Parameter.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, action.eResource().getResourceSet());
    dialog.setProvidedService(Parameter.class);
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        if (o instanceof Signature) {
            if (!o.equals(seff.getDescribedService__SEFF())) {
                dialog.getTreeViewer().remove(o);
                continue;
            }
            EList<Parameter> parameters = null;
            if (o instanceof OperationSignature)
                parameters = ((OperationSignature) o).getParameters__OperationSignature();
            else if (o instanceof InfrastructureSignature) {
                parameters = ((InfrastructureSignature) o).getParameters__InfrastructureSignature();
            }
            for (Parameter p : parameters) {
                if (!(p.getDataType__Parameter() instanceof CollectionDataType))
                    dialog.getTreeViewer().remove(p);
            }
        }
    }
    dialog.open();
    return (Parameter) dialog.getResult();
}
Also used : OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) InfrastructureSignature(org.palladiosimulator.pcm.repository.InfrastructureSignature) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) InfrastructureSignature(org.palladiosimulator.pcm.repository.InfrastructureSignature) OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) Signature(org.palladiosimulator.pcm.repository.Signature) CollectionDataType(org.palladiosimulator.pcm.repository.CollectionDataType) ArrayList(java.util.ArrayList) Parameter(org.palladiosimulator.pcm.repository.Parameter) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 23 with PalladioSelectEObjectDialog

use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class SetRequiredResource method getProcessingResourceType.

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

Example 24 with PalladioSelectEObjectDialog

use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class SetResourceCallRequiredRole method getSignature.

private ResourceRequiredRole getSignature(final ResourceCall call) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(ResourceRequiredRole.class);
    filter.add(BasicComponent.class);
    filter.add(ResourceInterface.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, call.eResource().getResourceSet());
    dialog.setProvidedService(ResourceRequiredRole.class);
    dialog.open();
    return (ResourceRequiredRole) dialog.getResult();
}
Also used : PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) ResourceRequiredRole(org.palladiosimulator.pcm.core.entity.ResourceRequiredRole) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 25 with PalladioSelectEObjectDialog

use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog 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)

Aggregations

PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)29 ArrayList (java.util.ArrayList)28 EObject (org.eclipse.emf.ecore.EObject)28 EReference (org.eclipse.emf.ecore.EReference)28 BasicComponent (org.palladiosimulator.pcm.repository.BasicComponent)4 EventGroup (org.palladiosimulator.pcm.repository.EventGroup)4 OperationInterface (org.palladiosimulator.pcm.repository.OperationInterface)4 InfrastructureInterface (org.palladiosimulator.pcm.repository.InfrastructureInterface)3 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)3 Signature (org.palladiosimulator.pcm.repository.Signature)3 ProcessingResourceType (org.palladiosimulator.pcm.resourcetype.ProcessingResourceType)3 ServiceEffectSpecification (org.palladiosimulator.pcm.seff.ServiceEffectSpecification)3 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)2 ResourceRequiredRole (org.palladiosimulator.pcm.core.entity.ResourceRequiredRole)2 InfrastructureSignature (org.palladiosimulator.pcm.repository.InfrastructureSignature)2 OperationProvidedRole (org.palladiosimulator.pcm.repository.OperationProvidedRole)2 PassiveResource (org.palladiosimulator.pcm.repository.PassiveResource)2 RequiredRole (org.palladiosimulator.pcm.repository.RequiredRole)2 ResourceInterface (org.palladiosimulator.pcm.resourcetype.ResourceInterface)2 SchedulingPolicy (org.palladiosimulator.pcm.resourcetype.SchedulingPolicy)2