use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSystemSpecifiedExecutionTime method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
SystemSpecifiedExecutionTime sset = (SystemSpecifiedExecutionTime) parameters.get("instance");
Signature sig = getSignature(sset);
for (SpecifiedQoSAnnotation s : sset.getQosAnnotations_SpecifiedQoSAnnotation().getSpecifiedQoSAnnotations_QoSAnnotations()) {
if ((s instanceof SystemSpecifiedExecutionTime) && (s.getSignature_SpecifiedQoSAnnation() != null) && (s.getRole_SpecifiedQoSAnnotation().equals(sset.getRole_SpecifiedQoSAnnotation())) && (s.getSignature_SpecifiedQoSAnnation().equals(sig)))
return;
}
sset.setSignature_SpecifiedQoSAnnation(sig);
}
use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSystemSpecifiedExecutionTime method getSignature.
private Signature getSignature(SystemSpecifiedExecutionTime sset) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(Interface.class);
filter.add(Signature.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, sset.eResource().getResourceSet());
dialog.setProvidedService(Signature.class);
dialog.open();
return (Signature) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSEFF method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
ResourceDemandingSEFF seff = (ResourceDemandingSEFF) parameters.get("instance");
Signature signature = getSignature(seff);
for (ServiceEffectSpecification s : seff.getBasicComponent_ServiceEffectSpecification().getServiceEffectSpecifications__BasicComponent()) {
if (s.getDescribedService__SEFF() != null && s.getDescribedService__SEFF().equals(signature)) {
// do nothing if the chosen signature already has a corresponding SEFF
return;
}
}
seff.setDescribedService__SEFF(signature);
}
use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSEFF method getSignature.
private Signature getSignature(ResourceDemandingSEFF seff) {
// Filter list (Repository > Interface > Signature)
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(Interface.class);
filter.add(Signature.class);
// Additional Child References
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
// Creating the dialog
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, seff.eResource().getResourceSet());
// Setting the needed object type
dialog.setProvidedService(Signature.class);
// Filter: Show only provided interfaces
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
EList<ProvidedRole> providedRoles = parent.getProvidedRoles_InterfaceProvidingEntity();
if (o instanceof Interface) {
if (!isReferenced(providedRoles, (Interface) o)) {
dialog.getTreeViewer().remove(o);
}
}
}
dialog.open();
return (Signature) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.Signature in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddCollectionIteratorAction method getParameter.
private Parameter getParameter(CollectionIteratorAction action, ServiceEffectSpecification seff) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(Interface.class);
filter.add(Signature.class);
filter.add(Parameter.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, action.eResource().getResourceSet());
dialog.setProvidedService(Parameter.class);
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (o instanceof Signature) {
if (!o.equals(seff.getDescribedService__SEFF())) {
dialog.getTreeViewer().remove(o);
continue;
}
EList<Parameter> parameters = null;
if (o instanceof OperationSignature)
parameters = ((OperationSignature) o).getParameters__OperationSignature();
else if (o instanceof InfrastructureSignature) {
parameters = ((InfrastructureSignature) o).getParameters__InfrastructureSignature();
}
for (Parameter p : parameters) {
if (!(p.getDataType__Parameter() instanceof CollectionDataType))
dialog.getTreeViewer().remove(p);
}
}
}
dialog.open();
return (Parameter) dialog.getResult();
}
Aggregations