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
* Match both the input and id, so that different types of editor can be opened on the same input.
     */
    private static final int MATCH_BOTH = IWorkbenchPage.MATCH_INPUT | IWorkbenchPage.MATCH_ID;
    
    /*
     * Compares the labels from two IEditorDescriptor objects 
     */
    private static final Comparator comparer = new Comparator() {
        private Collator collator = Collator.getInstance();
        public int compare(Object arg0, Object arg1) {
            String s1 = ((IEditorDescriptor) arg0).getLabel();
            String s2 = ((IEditorDescriptor) arg1).getLabel();
            return collator.compare(s1, s2);
        }
    };
    /**
     * Constructs a new instance of <code>OpenWithMenu</code>. 
     * <p>
     * If this method is used be sure to set the selected file by invoking
     * <code>setFile</code>.  The file input is required when the user
     * selects an item in the menu.  At that point the menu will attempt to
     * open an editor with the file as its input.
     * </p>
     *
     * @param page the page where the editor is opened if an item within
     *		the menu is selected
     */
    public OpenWithMenu(IWorkbenchPage page) {
        this(page, null);
    }