use of bndtools.tasks.ResourceCapReqLoader in project bndtools by bndtools.
the class ResolutionView method getLoadersFromSelection.
private Set<CapReqLoader> getLoadersFromSelection(IStructuredSelection structSel) {
Set<CapReqLoader> result = new LinkedHashSet<CapReqLoader>();
Iterator<?> iter = structSel.iterator();
while (iter.hasNext()) {
Object element = iter.next();
CapReqLoader loader = null;
File file = SelectionUtils.adaptObject(element, File.class);
if (file != null) {
loader = getLoaderForFile(file);
} else {
IResource eresource = SelectionUtils.adaptObject(element, IResource.class);
if (eresource != null) {
IPath location = eresource.getLocation();
if (location != null) {
loader = getLoaderForFile(location.toFile());
}
} else if (element instanceof RepositoryResourceElement) {
Resource resource = ((RepositoryResourceElement) element).getResource();
loader = new ResourceCapReqLoader(resource);
}
}
if (loader != null)
result.add(loader);
}
return result;
}
Aggregations