Bug 2345 [Editor Mgmt] Open with a different type of editor has no effect if file already open (1GEWMSQ)
Reproduce the steps in: 1GEWMOZ: ITPUI:WIN2000 - Scripted resource editor example opens on XML files by default - new basic project - new file test.xml - the editor used is the scripted resource editor example, which totally ignores the XML file content - select test.xml in Navigator - choose Open With... / Default Text Editor - nothing happens; it's reactivating the scripted resource editor example Searching for an existing open file should also consider editor types. It should open a new editor on the file, because the editor type is different. NOTES:
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/OpenWithMenu.java
*/
    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;
        
        
        ArrayList alreadyMapped = new ArrayList();
        for (int i = 0; i < editors.length; i++) {
            IEditorDescriptor editor = (IEditorDescriptor) editors[i];
            if (!alreadyMapped.contains(editor)) {
                createMenuItem(menu, editor, preferredEditor);
                if (defaultEditor != null
                        && editor.getId().equals(defaultEditor.getId()))
                    defaultFound = true;
                alreadyMapped.add(editor);
            }
        }
        
        if (editors.length > 0)
            new MenuItem(menu, SWT.SEPARATOR);
        
        if (!defaultFound && defaultEditor != null) {