use of bndtools.model.repo.ProjectBundle in project bndtools by bndtools.
the class MapValuesContentProvider method doAdd.
void doAdd() {
IStructuredSelection selection = (IStructuredSelection) availableViewer.getSelection();
List<VersionedClause> adding = new ArrayList<VersionedClause>(selection.size());
for (Iterator<?> iter = selection.iterator(); iter.hasNext(); ) {
Object item = iter.next();
if (item instanceof RepositoryBundle) {
adding.add(RepositoryBundleUtils.convertRepoBundle((RepositoryBundle) item));
} else if (item instanceof RepositoryBundleVersion) {
adding.add(RepositoryBundleUtils.convertRepoBundleVersion((RepositoryBundleVersion) item, phase));
} else if (item instanceof ProjectBundle) {
String bsn = ((ProjectBundle) item).getBsn();
Attrs attribs = new Attrs();
attribs.put(Constants.VERSION_ATTRIBUTE, "latest");
adding.add(new VersionedClause(bsn, attribs));
}
}
if (!adding.isEmpty()) {
for (VersionedClause clause : adding) {
selectedBundles.put(clause.getName(), clause);
}
selectedViewer.add(adding.toArray());
availableViewer.refresh();
propSupport.firePropertyChange(PROP_SELECTION, null, selectedBundles);
}
}
Aggregations