code: @SuppressWarnings("unchecked")
  	private IResource[] getSelectedResources(IStructuredSelection selection) {
  		ArrayList<Object> selectedResources = new ArrayList<Object>();
  
  		for (Iterator<Object> i = selection.iterator(); i.hasNext();) {
  			Object o = i.next();
  			if (o instanceof IResource) {
  				selectedResources.add(o);
  			} else if (o instanceof IAdaptable) {
  				IAdaptable a = (IAdaptable) o;
  				IResource r = (IResource) a.getAdapter(IResource.class);
  				if (r != null) {
  					selectedResources.add(r);
  				}
  			}
  		}
  		return (IResource[]) selectedResources
  				.toArray(new IResource[selectedResources.size()]);
  	}
docs: Returns the resource selection from the LocalSelectionTransfer.
  
  @return the resource selection from the LocalSelectionTransfer