Bug 46395 [RCP] Open With not persistent
N20031111 Start fresh workspace and create a type in a new Java project. Close the Java editor Select the file, Open With > Text editor Close the text editor Double-click the file ==> opens in Java editor. Before RCP it used to remember which editor was used.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/OpenWithMenu.java
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.getString("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{
							IDE.openEditor(page, file, true);
						} catch (PartInitException e) {
							DialogUtil.openError(
								page.getWorkbenchWindow().getShell(),
								IDEWorkbenchMessages.getString("OpenWithMenu.dialogTitle"), 
								e.getMessage(),
								e);
						}
					}
					break;
			}
		}
	};
	
	menuItem.addListener(SWT.Selection, listener);
}
}