use of org.palladiosimulator.pcm.resourcetype.ResourceSignature 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.resourcetype.ResourceSignature in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceCallSignature method execute.
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
ResourceCall call = (ResourceCall) parameters.get("instance");
ResourceSignature sig = getSignature(call);
call.setSignature__ResourceCall(sig);
}
Aggregations