Bug 226867 [Browser] Web browser preference change causes web browser editor error through open file
Build ID: M20080221-1800 Steps To Reproduce: 1.File->Open file...->A htm file 2.Open successfullly 3.Windows->Preferences...->Web browser->Change any setting(even later change back)->Apply 4.File->Open file...->Same htm file 5.Open failed. org.eclipse.ui.PartInitException: Could not open Web browser on abc.htm. Ensure that it is an uncompressed file. at org.eclipse.ui.internal.browser.WebBrowserEditor.init(WebBrowserEditor.java:225) More information: It seems that web browser preference change affects browser editor setings.When first open a htm file, the FileStoreEditorInput adapters a WebBrowserEditorInput. After change, the FileStoreEditorInput can adapters neither a IPathEditorInput or a WebBrowserEditorInput.A PartInitException ocurred.
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java
public boolean isSaveAsAllowed() {
		return false;
	}
	/**
	 * Open the input in the internal Web browser.
	 */
	public static void open(WebBrowserEditorInput input) {
		IWorkbenchWindow workbenchWindow = WebBrowserUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
		IWorkbenchPage page = workbenchWindow.getActivePage();
		try {
			IEditorReference[] editors = page.getEditorReferences();
			int size = editors.length;
			for (int i = 0; i < size; i++) {
				if (WEB_BROWSER_EDITOR_ID.equals(editors[i].getId())) {
					IEditorPart editor = editors[i].getEditor(true);
					if (editor != null && editor instanceof WebBrowserEditor) {
						WebBrowserEditor webEditor = (WebBrowserEditor) editor;
						WebBrowserEditorInput input2 = webEditor.getWebBrowserEditorInput();
						if (input2 == null || input.canReplaceInput(input2)) {
							editor.init(editor.getEditorSite(), input);
							return;
						}
					}
				}
			}
			
			page.openEditor(input, WebBrowserEditor.WEB_BROWSER_EDITOR_ID);
		} catch (Exception e) {
			Trace.trace(Trace.SEVERE, "Error opening Web browser", e); 
		}