Bug 29633 [EditorMgmt] "Open" menu should have Open With-->Other
While registering file associations in the preferences page is mostly a reasonable proposition, it seems that having an "Open With --> Other" option would be helpful. This came up originally for me registering .sqlj files with the Java Editor. For unrelated reasons Eclipse is getting locked up by external tools, and I keep having to re-specify my preference since I had to kill Eclipse and the workspace was not saved. The implementation may also be helpful for contributers with editors on non-file resources, as they could reuse whatever dialog pops up when Open With --> Other is presented. -Andrew
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/OpenWithMenu.java
* @param menu the menu to add the item to
     * @param file the file being edited
     */
    private void createDefaultMenuItem(Menu menu, final IFile file) {
        final MenuItem menuItem = new MenuItem(menu, SWT.RADIO);
        menuItem.setSelection(IDE.getDefaultEditor(file) == null);
        menuItem.setText(IDEWorkbenchMessages.DefaultEditorDescription_name);
        Listener listener = new Listener() {
            public void handleEvent(Event event) {
                switch (event.type) {
                case SWT.Selection:
                    if (menuItem.getSelection()) {
                        IDE.setDefaultEditor(file, null);
                        try {
                        	IEditorDescriptor desc = IDE.getEditorDescriptor(file);
                            page.openEditor(new FileEditorInput(file), desc.getId(), true, MATCH_BOTH);
                        } catch (PartInitException e) {
                            DialogUtil.openError(page.getWorkbenchWindow()
                                    .getShell(), IDEWorkbenchMessages.OpenWithMenu_dialogTitle,
                                    e.getMessage(), e);
                        }
                    }
                    break;
                }
            }
        };
        menuItem.addListener(SWT.Selection, listener);
    }
}