use of org.palladiosimulator.pcm.repository.BasicComponent 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();
}
Aggregations