public static Set<WorkItem> getResources(IWorkingSet wset) {
Set<WorkItem> set = new HashSet<WorkItem>();
boolean aggregateWorkingSet = wset.isAggregateWorkingSet();
// IAggregateWorkingSet was introduced in Eclipse 3.5
if (aggregateWorkingSet && wset instanceof IAggregateWorkingSet) {
IAggregateWorkingSet aggr = (IAggregateWorkingSet) wset;
IWorkingSet[] sets = aggr.getComponents();
for (IWorkingSet iWorkingSet : sets) {
set.addAll(getResources(iWorkingSet));
}
} else {
IAdaptable[] elements = wset.getElements();