Bug 29755 Attach source does not allow one to select a folder... [build path]
When opening some .class that does not yet have a source attachment eclipse shows a text version of the interface defintion and a button for Attaching source. When pressing this button a window appaer where one can enter the name/location of a folder, zip or jar for the source. There are also a button for choosing it via a file selection dialog and this works fine for zip and jar files - but not for selecting a directory :( Workaround is just to enter the directory manually.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
* Creates a runnable that sets the source attachment by modifying the
	 * project's classpath or updating a container.
	 */
	public IRunnableWithProgress getRunnable(final Shell shell) {
		return new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {				
				try {
					attachSource(shell, monitor);
				} catch (CoreException e) {
					throw new InvocationTargetException(e);
				}
			}
		};
	}	
	
	
	protected void attachSource(final Shell shell, IProgressMonitor monitor) throws CoreException {
		boolean isExported= fEntry.isExported();
		IClasspathEntry newEntry;
		if (fEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
			newEntry= JavaCore.newVariableEntry(fEntry.getPath(), getSourceAttachmentPath(), getSourceAttachmentRootPath(), isExported);
		} else {
			newEntry= JavaCore.newLibraryEntry(fEntry.getPath(), getSourceAttachmentPath(), getSourceAttachmentRootPath(), isExported);
		}
		if (fContainerPath != null) {
			updateContainerClasspath(fProject, fContainerPath, newEntry, monitor);
		} else {
			updateProjectClasspath(shell, fProject, newEntry, monitor);
		}
	}