Search in sources :

Example 6 with ProcessingResourceType

use of org.palladiosimulator.pcm.resourcetype.ProcessingResourceType in project Palladio-Editors-Sirius by PalladioSimulator.

the class SetRequiredResource method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    ParametricResourceDemand rd = (ParametricResourceDemand) parameters.get("instance");
    ProcessingResourceType rt = getProcessingResourceType(rd);
    rd.setRequiredResource_ParametricResourceDemand(rt);
}
Also used : ParametricResourceDemand(org.palladiosimulator.pcm.seff.seff_performance.ParametricResourceDemand) ProcessingResourceType(org.palladiosimulator.pcm.resourcetype.ProcessingResourceType)

Example 7 with ProcessingResourceType

use of org.palladiosimulator.pcm.resourcetype.ProcessingResourceType 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)

Aggregations

ProcessingResourceType (org.palladiosimulator.pcm.resourcetype.ProcessingResourceType)7 EObject (org.eclipse.emf.ecore.EObject)5 ArrayList (java.util.ArrayList)3 EReference (org.eclipse.emf.ecore.EReference)3 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)3 ProcessingResourceSpecification (org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification)2 SchedulingPolicy (org.palladiosimulator.pcm.resourcetype.SchedulingPolicy)2 Test (org.junit.Test)1 PCMRandomVariable (org.palladiosimulator.pcm.core.PCMRandomVariable)1 HDDProcessingResourceSpecification (org.palladiosimulator.pcm.resourceenvironment.HDDProcessingResourceSpecification)1 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)1 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)1 ResourceEnvironment (org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment)1 ParametricResourceDemand (org.palladiosimulator.pcm.seff.seff_performance.ParametricResourceDemand)1