try {
MetadataModel model = getModel();
Object[] results = dialog.getResult();
if(results.length > 1) {
for(Object result : results) {
VersionedName module = (VersionedName) result;
model.addDependency(
module.getModuleName().toString(), module.getVersion().toString());
}
}
else
model.addDependency(dialog.getName(), dialog.getVersionRequirement());
}