use of org.palladiosimulator.pcm.resourcetype.ResourceInterface 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.resourcetype.ResourceInterface 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.ResourceInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceInterface method getResourceInterface.
private ResourceInterface getResourceInterface(ResourceRequiredRole resourceRequiredRole) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(ResourceRepository.class);
filter.add(ResourceInterface.class);
// Additional Child References
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
// Creating the dialog
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, resourceRequiredRole.eResource().getResourceSet());
// Setting the needed object type
dialog.setProvidedService(ResourceInterface.class);
dialog.open();
return (ResourceInterface) dialog.getResult();
}
Aggregations