Bug 19104 Basket for problems with .java files outside build path
1) .java file is not inside a source folder - "Rename" refactoring is enabled but does not work: no preview and does not rename if finished is pressed. 2) .java file that is inside a non-Java project - Lots of problems when views hold on to a working copy which can not be mapped to a compilation unit after the editor has been closed - shows red squiggly lines when using "Show Source of selected element only" - same problems as 1) MORE WILL FOLLOW TOMORROW
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenExternalJavadocAction.java
}
			}
		
			URL url= JavaDocLocations.getJavadocLocation(element, true);
			if (url != null) {
				OpenBrowserUtil.open(url, shell, getTitle());
			} 		
		} catch (CoreException e) {
			JavaPlugin.log(e);
			showMessage(shell, ActionMessages.getString("OpenExternalJavadocAction.opening_failed"), true); 
		}
	}
	
	private static void showMessage(final Shell shell, final String message, final boolean isError) {
		Display.getDefault().asyncExec(new Runnable() {
			public void run() {
				if (isError) {
					MessageDialog.openError(shell, getTitle(), message); 
				} else {
					MessageDialog.openInformation(shell, getTitle(), message); 
				}
			}
		});
	}
	
	private static String getTitle() {
		return ActionMessages.getString("OpenExternalJavadocAction.dialog.title"); 
	}
}