Bug 303344 OpenWithMenu unnecessarily downcasts to WorkbenchPage
I got an exception when trying to use 'Open With...' in the compatibility layer. On line 344, we downcast to invoke openEditor(IEditorInput, String, boolean, int), which is actually a public API method. We should remove the downcast so that it will run on unchanged.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/OpenWithMenu.java
fileResource.getName()));
					if (dialog.open() == Window.OK) {
						IEditorDescriptor editor = dialog.getSelectedEditor();
						if (editor != null) {
							openEditor(editor, editor.isOpenExternal());
						}
					}
                    break;
                }
            }
        };
        menuItem.addListener(SWT.Selection, listener);
    }
    
    /* (non-Javadoc)
     * Fills the menu with perspective items.
     */
    public void fill(Menu menu, int index) {
        IFile file = getFileResource();
        if (file == null) {
            return;
        }
        IEditorDescriptor defaultEditor = registry
                .findEditor(IDEWorkbenchPlugin.DEFAULT_TEXT_EDITOR_ID); 
        IEditorDescriptor preferredEditor = IDE.getDefaultEditor(file); 
        Object[] editors = registry.getEditors(file.getName(), IDE.getContentType(file));
        Collections.sort(Arrays.asList(editors), comparer);
        boolean defaultFound = false;