use of org.palladiosimulator.pcm.repository.CollectionDataType in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetInnerType method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
CollectionDataType cdt = (CollectionDataType) parameters.get("collection");
DataType dt = DataTypeSelectionWizard.selectDataType(cdt);
if (dt != null)
cdt.setInnerType_CollectionDataType(dt);
}
use of org.palladiosimulator.pcm.repository.CollectionDataType 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