bndtools.model.repo.SearchableRepositoryTreeContentProvider Maven / Gradle / Ivy
The newest version!
package bndtools.model.repo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import aQute.bnd.service.RepositoryPlugin;
import aQute.bnd.service.repository.SearchableRepository;
public class SearchableRepositoryTreeContentProvider extends RepositoryTreeContentProvider {
@Override
Object[] getRepositoryBundles(RepositoryPlugin repo) {
Object[] bundles = super.getRepositoryBundles(repo);
Object[] result = bundles;
if (repo instanceof SearchableRepository) {
String filter = getFilter();
if (filter != null && filter.length() > 0) {
ContinueSearchElement newElem = new ContinueSearchElement(filter, (SearchableRepository) repo);
if (bundles != null) {
result = new Object[bundles.length + 1];
System.arraycopy(bundles, 0, result, 0, bundles.length);
result[bundles.length] = newElem;
} else {
result = new Object[] {
newElem
};
}
}
}
return result;
}
public List allRepoBundleVersions(final RepositoryPlugin rp) {
Object[] result = getChildren(rp);
List allChildren = new ArrayList<>();
Queue
© 2015 - 2024 Weber Informatics LLC | Privacy Policy