This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 417960 - [EditorMgmt] History view dropdown menu disappears
Summary: [EditorMgmt] History view dropdown menu disappears
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 420612
  Show dependency tree
 
Reported: 2013-09-24 15:38 EDT by Paul Webster CLA
Modified: 2013-10-30 09:00 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2013-09-24 15:38:03 EDT
I have the history view showing the history for eclipse.platform.ui.

I can open its view dropdown menu.

If I activate another view like the package explorer, the History view dropdown menu disappears.  It doesn't come back activating the view.

If I activate another view in the same view stack and come back to the History view the dropdown menu is back.

PW
Comment 1 Paul Webster CLA 2013-09-24 15:58:00 EDT
Caused by the changes for bug 416650

PW
Comment 2 Paul Webster CLA 2013-09-24 15:59:30 EDT
I was able to fix this by reverting http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=325bc186c4840e112eea9124313d16bd56da54e7

PW
Comment 3 Eric Moffatt CLA 2013-09-25 11:32:29 EDT
For me this only happens if the CTF's 'topRight' control has been wrapped onto the second line (under the tab area) and, seemingly, only for the History view (at least my tries at getting other views to fail has itself failed).

I'm at a loss, it's obviously a layout error since resizing the CTF to move the TR back into the tab area and then back restores the drop down arrow (so it's there in the SWT composite).

The call that needed to be restored was the one in 'layoutTopRight' which is called from updateActionBars. If I set the layout to (true, true) then it works, otherwise not.

Apparently the GenericHistoryView beats on updateActionBars more often than most views, perhaps a result of being a PageBook ?

Even changing from

layout(true, true) to ctf.layout(new Control[] { ctf.getTopRight() });

doesn't fix the issue but I'm loathe to blame this on SWT unless we can determine why it works for so many other views. The TB is quite long and has more separators than most is the only obvious difference I can see.
Comment 4 Eric Moffatt CLA 2013-09-27 15:13:35 EDT
OK, here's the scoop:

First, For the EGit history view there's a call up 'updateActionBars' on both focusGained as well as focusLost (at least). This is some sort of anti-pattern; at least I haven't found another view that does it.

updateActionBars disposes the old view Menu's TB but does *not* do a 'pack' which is why the item disappears. The reason it doesn't re-appear when it's re-created is because of the lack of a 'pack' when the TB got disposed, meaning that the 'pack' when its re-created ends up with the existing size.

The initial fix is to simply pack the topRight control in StackRenderer#disposeViewMenu. This appears to fix the issue but is sub-optimal in that we're cycling the view menu without reason. This is easy to show; just make the stack large enough to show the history's toolbar appear in the tab area. Now shrink it just by a pixel or two so that it wraps. Now you'll see a flicker as the toolbar moves between the tabbed area and wrapping to the next line as the view toolbar goes and then comes.

I'll commit the fix outlined above (since disposing the menu TB should re-pack) but we should also take a look at seeing whether we can avoid unnecessarily disposing the view menu tb in updateActionBars...
Comment 5 Eric Moffatt CLA 2013-10-02 14:16:36 EDT
OK, Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e8f26c57c3cc23406f6dc1cf060b1b73f280f2af

This is a major re-write of how we manage the top-right area of the View stacks; please be on the lookout for anything different than before.  

The previous approach was to dispose everything first, then re-create the new stuff. This one treats everything in one optimized step (i.e. the view drop down Toolbar won't get disposed and then re-created anymore both the old and new tabs require one...). This lead to a fair amount of flicker and also induced some other issues (like this defect), to me everything seems a bit more stable now.

The only thing I'm not particularly happy about is the non-recursion check I had to add. This is an initial rendering issue where the StackRenderer's 'updateTopRight' calls 'createWidget' on its MToolbar and the RenderedToolbarRenderer calls updateActionBars which leads to the recursion...
Comment 6 Paul Webster CLA 2013-10-02 16:19:23 EDT
This caused 3 test failures in the UiTestSuites:


UI Test Suite-fixed
org.eclipse.ui.tests.UiTestSuite
org.eclipse.ui.tests.api.ApiTestSuite
org.eclipse.ui.tests.api.IViewActionDelegateTest
testInit(org.eclipse.ui.tests.api.IViewActionDelegateTest)
junit.framework.AssertionFailedError: Unable to find action: Mock Action
	at junit.framework.Assert.fail(Assert.java:57)
	at org.eclipse.ui.tests.harness.util.ActionUtil.runActionWithLabel(ActionUtil.java:67)
	at org.eclipse.ui.tests.api.IViewActionDelegateTest.runAction(IViewActionDelegateTest.java:59)
	at org.eclipse.ui.tests.api.IActionDelegateTest.testRun(IActionDelegateTest.java:45)
	at org.eclipse.ui.tests.api.IViewActionDelegateTest.testInit(IViewActionDelegateTest.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3715)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3364)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:144)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:613)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

testRun(org.eclipse.ui.tests.api.IViewActionDelegateTest)
junit.framework.AssertionFailedError: Unable to find action: Mock Action
	at junit.framework.Assert.fail(Assert.java:57)
	at org.eclipse.ui.tests.harness.util.ActionUtil.runActionWithLabel(ActionUtil.java:67)
	at org.eclipse.ui.tests.api.IViewActionDelegateTest.runAction(IViewActionDelegateTest.java:59)
	at org.eclipse.ui.tests.api.IActionDelegateTest.testRun(IActionDelegateTest.java:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3715)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3364)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:144)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:613)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

testSelectionChanged(org.eclipse.ui.tests.api.IViewActionDelegateTest)
junit.framework.AssertionFailedError: Unable to find action: Mock Action
	at junit.framework.Assert.fail(Assert.java:57)
	at org.eclipse.ui.tests.harness.util.ActionUtil.runActionWithLabel(ActionUtil.java:67)
	at org.eclipse.ui.tests.api.IViewActionDelegateTest.runAction(IViewActionDelegateTest.java:59)
	at org.eclipse.ui.tests.api.IActionDelegateTest.testSelectionChanged(IActionDelegateTest.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3715)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3364)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:144)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:613)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 7 Eric Moffatt CLA 2013-10-03 15:24:04 EDT
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7c2051c64a1cb377923565018609ea5d10524448

This safes up the 'adjustTopRight' code, using a try / catch to ensure that the 'adjusting' boolean never remains 'true'. The problem with the tests was that in certain scenarios the teardown of the previous test would end up leaving the value 'true'.
Comment 8 Eric Moffatt CLA 2013-10-29 13:19:11 EDT
Verified in 4.4.0.I20131028-2000.
Comment 9 Dani Megert CLA 2013-10-30 09:00:23 EDT
This broke the 'Show View Menu' command (see bug 420612).