use of org.palladiosimulator.pcm.repository.InfrastructureInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetInfrastructureSignature method getSignature.
private InfrastructureSignature getSignature(InfrastructureCall call) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(InfrastructureInterface.class);
filter.add(InfrastructureSignature.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, call.eResource().getResourceSet());
dialog.setProvidedService(InfrastructureSignature.class);
// only take required InfrastructureInterfaces
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (!(o instanceof InfrastructureInterface))
continue;
ServiceEffectSpecification seff = (ServiceEffectSpecification) call.getAction__InfrastructureCall().getResourceDemandingBehaviour_AbstractAction();
BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
boolean found = false;
for (RequiredRole r : parent.getRequiredRoles_InterfaceRequiringEntity()) {
if (!(r instanceof InfrastructureRequiredRole))
continue;
InfrastructureRequiredRole ir = (InfrastructureRequiredRole) r;
if (ir.getRequiredInterface__InfrastructureRequiredRole().equals(o)) {
found = true;
call.setRequiredRole__InfrastructureCall(ir);
}
}
if (!found)
dialog.getTreeViewer().remove(o);
}
dialog.open();
return (InfrastructureSignature) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.InfrastructureInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class InfrastructureInterfaceTableLifecycleManager method setPropertySection.
@Override
protected void setPropertySection(Composite parent) {
editorSection = new InfrastructureSignaturesEditorSection(parent);
editorSection.setViewerContentProvider(new AdapterFactoryContentProvider(adapterFactory));
editorSection.setViewerLabelProvider(new AdapterFactoryLabelProvider(new InfrastructureSignaturesTabItemProviderAdapterFactory(new PalladioItemProviderAdapterFactory(adapterFactory))));
InfrastructureInterface input = (InfrastructureInterface) controller.getValue();
editorSection.setViewerInput(input);
((InfrastructureSignaturesEditorSection) editorSection).getAddButtonListener().setSelectedInterface((InfrastructureInterface) input);
}
use of org.palladiosimulator.pcm.repository.InfrastructureInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddInfrastructureProvidedRole method getInfrastructureInterface.
private InfrastructureInterface getInfrastructureInterface(InfrastructureProvidedRole role) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(InfrastructureInterface.class);
// Additional Child References
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
// Creating the dialog
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, role.eResource().getResourceSet());
// Setting the needed object type
dialog.setProvidedService(InfrastructureInterface.class);
dialog.open();
return (InfrastructureInterface) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.InfrastructureInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddInfrastructureProvidedRole method execute.
@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
InfrastructureProvidedRole role = (InfrastructureProvidedRole) parameters.get("instance");
InfrastructureInterface iInterface = getInfrastructureInterface(role);
role.setProvidedInterface__InfrastructureProvidedRole(iInterface);
}
use of org.palladiosimulator.pcm.repository.InfrastructureInterface in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddInfrastructureRequiredRole method execute.
@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
InfrastructureRequiredRole role = (InfrastructureRequiredRole) parameters.get("instance");
InfrastructureInterface iInterface = getInfrastructureInterface(role);
role.setRequiredInterface__InfrastructureRequiredRole(iInterface);
}
Aggregations