Bug 9601 Open external JavaDoc does not work correctly with Netscape 4.76
Test Case: 0) Have Netscape 4.76 registered as system default browser. 1) Have JRE_LIB of 20020212-I in workspace 2) Context Menu -> Properties: Attach documentation location: 'M:\java\jdk1.2\docs\api\' 3) Verify that Netscape is not running. 4) Context Menu -> Open External Javadoc 5) Observer the error dialog: Cannot find the file 'file:/M:/JAVA/jdk1.2/docs/api/overview-summary.html' ... However, the html file is actually displayed. 6) Close the error dialog. 7) Browse to some other page in Netscape. 8) Do step 4) again. 9) The correct page is displayed w/o an error dialog.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenExternalJavadocAction.java
super();
		setText("Open E&xternal Javadoc@Shift+F2");
		setDescription("Opens the Javadoc of the selected element in an external browser");
		setToolTipText("Opens the Javadoc of the selected element in an external browser");
		fSelectionProvider= provider;
	}
	
	public void update() {
		setEnabled(canOperateOn());
	}
	
	private boolean canOperateOn() {
		if (fSelectionProvider != null) {
			IStructuredSelection selection= fSelectionProvider.getSelection(StructuredSelectionProvider.FLAGS_GET_EDITOR_INPUT);
			return selection.size() == 1;
		}
		return false;
	}
	
	private Object getSelectedElement() {
		if (fSelectionProvider == null) {
			return null;
		}
		
		IStructuredSelection selection= fSelectionProvider.getSelection(StructuredSelectionProvider.FLAGS_DO_CODERESOLVE | StructuredSelectionProvider.FLAGS_GET_EDITOR_INPUT);
		if (selection.size() != 1)
			return null;
			
		return selection.getFirstElement();
	}