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
initSel= fWorkspaceRoot.findMember(new Path(initSelection));
		}
		if (initSel == null) {
			initSel= fWorkspaceRoot.findMember(fEntry.getPath());
		}
		FolderSelectionDialog dialog= new FolderSelectionDialog(getShell(), lp, cp);
		dialog.setAllowMultiple(false);
		dialog.setValidator(validator);
		dialog.addFilter(filter);
		dialog.setTitle(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.title")); 
		dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.message")); 
		dialog.setInput(fWorkspaceRoot);
		dialog.setInitialSelection(initSel);
		if (dialog.open() == ElementTreeSelectionDialog.OK) {
			IResource res= (IResource) dialog.getFirstResult();
			return res.getFullPath();
		}
		return null;
	}
	
	private Shell getShell() {
		if (fSWTWidget != null) {
			return fSWTWidget.getShell();
		}
		return JavaPlugin.getActiveWorkbenchShell();			
	}
	
	/**
	 * Takes a path and replaces the beginning with a variable name
	 * (if the beginning matches with the variables value)