Bug 178235 [EditorMgmt] DBCS 3.3 - Cannot open file with external program
Product Build#: I20070306 Platform/Version : Windows Vista, 2003, XP Language: T.Chinese Releated Test Case #: ECLIPSE3.3 - M5 OPEN FILES WITH OTHER EDITORS JVM: IBM JRE 5.0 SR1 ===== DEFECT DESCRIPTION ===== From Package Explorer view, we failed to open a java file with external program such as notepad or iexplore. ===== STEPS TO RECREATE ===== 1. From Package Explorer view, select a file, and Open With > Other... from the context menu 2. select External Programs radio button 3. Click Browse.. buttom and select Text File(notepad.exe) program, then click OK 4. The error will display "Unable to open editor, unknown editor ID: <XXX>" ===== EXPECTED RESULT ===== notepad.exe can be specified and the file can be opened
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/OpenWithMenu.java
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.EditorSelectionDialog;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.internal.ide.DialogUtil;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.eclipse.ui.part.FileEditorInput;
import com.ibm.icu.text.Collator;
/**
 * A menu for opening files in the workbench.
 * <p>
 * An <code>OpenWithMenu</code> is used to populate a menu with
 * "Open With" actions.  One action is added for each editor which is applicable
 * to the selected file. If the user selects one of these items, the corresponding
 * editor is opened on the file.
 * </p>
 * <p>
 * This class may be instantiated; it is not intended to be subclassed.
 * </p>
 */
public class OpenWithMenu extends ContributionItem {