use of org.palladiosimulator.pcm.core.entity.ResourceRequiredRole in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceInterface method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
ResourceRequiredRole resourceRequiredRole = (ResourceRequiredRole) parameters.get("instance");
ResourceInterface resourceInterface = getResourceInterface(resourceRequiredRole);
if (resourceInterface != null)
resourceRequiredRole.setRequiredResourceInterface__ResourceRequiredRole(resourceInterface);
}
use of org.palladiosimulator.pcm.core.entity.ResourceRequiredRole in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceCallSignature method getSignature.
private ResourceSignature getSignature(final ResourceCall call) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(ResourceRepository.class);
filter.add(ResourceSignature.class);
filter.add(ResourceInterface.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, call.eResource().getResourceSet());
dialog.setProvidedService(ResourceSignature.class);
// only take required InfrastructureInterfaces
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (!(o instanceof ResourceInterface)) {
continue;
}
ResourceRequiredRole resourceRequiredRole = call.getResourceRequiredRole__ResourceCall();
if (!resourceRequiredRole.getRequiredResourceInterface__ResourceRequiredRole().equals(o)) {
dialog.getTreeViewer().remove(o);
}
}
dialog.open();
return (ResourceSignature) dialog.getResult();
}
use of org.palladiosimulator.pcm.core.entity.ResourceRequiredRole 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();
}
use of org.palladiosimulator.pcm.core.entity.ResourceRequiredRole in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceCallRequiredRole method execute.
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
ResourceCall call = (ResourceCall) parameters.get("instance");
ResourceRequiredRole requiredRole = getSignature(call);
call.setResourceRequiredRole__ResourceCall(requiredRole);
}
Aggregations