code: public IResource getLaunchableResource(ISelection selection)
  	{
  		if (selection instanceof IStructuredSelection)
  		{
  			IStructuredSelection ss = (IStructuredSelection) selection;
  			if (ss.size() == 1)
  			{
  				Object element = ss.getFirstElement();
  				if (element instanceof IAdaptable)
  				{
  					return getLaunchableResource((IAdaptable) element);
  				}
  			}
  		}
  		return null;
  	}
docs: /*
  (non-Javadoc)
  @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)