Bug 533633 - "Link w/ Editor" fails for JDT editor out of source folder

This fix the link with editor by not converting files to Java element in
the CNF provider, when elements are not in build path.

Change-Id: Ic3313c8f103e2a7469d62329e684a09fc23e0598
Signed-off-by: Mickael Istria <mistria@redhat.com>
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorContentProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorContentProvider.java
index 8375002..e4c2c34 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorContentProvider.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorContentProvider.java
@@ -284,14 +284,13 @@
 	private boolean convertToJavaElements(Set<Object> currentChildren) {
 
 		LinkedHashSet<Object> convertedChildren = new LinkedHashSet<>();
-		IJavaElement newChild;
 		for (Iterator<Object> childrenItr = currentChildren.iterator(); childrenItr
 				.hasNext();) {
 			Object child = childrenItr.next();
 			// only convert IFolders and IFiles
 			if (child instanceof IFolder || child instanceof IFile) {
-				if ((newChild = JavaCore.create((IResource) child)) != null
-						&& newChild.exists()) {
+				IJavaElement newChild = JavaCore.create((IResource) child);
+				if (newChild != null && newChild.exists() && newChild.getJavaProject().isOnClasspath(newChild)) {
 					childrenItr.remove();
 					convertedChildren.add(newChild);
 				}