final IWorkbenchSite site = getSite();
final ISelection selection = site.getSelectionProvider().getSelection();
if (selection instanceof IStructuredSelection) {
final IStructuredSelection ss = (IStructuredSelection) selection;
final Collection<IProject> result = Sets.newHashSet();
for (final Object element : ss.toList()) {
if (element instanceof IErlElement) {
final IErlElement e = (IErlElement) element;
result.add(e.getResource().getProject());
} else if (element instanceof IResource) {
final IResource r = (IResource) element;