Project: Eclipse_Platform_UI
Bug 317102 [EditorMgmt] Recursive editor activation when using AbstractMultiEditor
Reported: 2010-06-16 14:49:13 | Status: verified fixed

Steps: 1) Create an multi pane editor implmentation based on AbstractMultiEditor. 2) In my implementation, the multi editor returns a sashform as the main composite 3) Each of the sash form contains a view form. The view form is the parent of the inner editor. 4) Put focus on the inner editor on the left. 5) Put focus onto the outline view 6) Put focus on the inner editor on the right. Putting this as major for now, as there is no way around this and it happens on each activation. Got the following stack trace: java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part com.ibm.editor.multi while still in the middle of activating part com.ibm.editor.raw at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3487) at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077) at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279) at org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:98) at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1076) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1424) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2631) at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2401) at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:4791) at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:448) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4228) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:994) at org.eclipse.swt.widgets.Control.setFocus(Control.java:2999) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1053) at org.eclipse.ui.texteditor.AbstractTextEditor.setFocus(AbstractTextEditor.java:6003) at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:102) at org.eclipse.ui.part.AbstractMultiEditor.setFocus(AbstractMultiEditor.java:138) at org.eclipse.ui.internal.PartPane.setFocus(PartPane.java:332) at org.eclipse.ui.internal.EditorPane.setFocus(EditorPane.java:127) at org.eclipse.ui.internal.WorkbenchPage$3.run(WorkbenchPage.java:629) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.runtime.Platform.run(Platform.java:888) at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:624) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3533) at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077) at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279) at org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:98) at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1076) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1424) at org.eclipse.swt.widgets.Shell.WM_MOUSEACTIVATE(Shell.java:2297) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4202) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4250) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:3024) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3652) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/AbstractMultiEditorTest.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/ConcreteAbstractMultiEditor.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTestSuite.java