Community
Participate
Working Groups
Created attachment 277105 [details] Gif of the issue Hi! I'm currently working on an RCP application that uses the reopenEditors ContributionItem in the Menu bar (via the ContributionItemFactory.REOPEN_EDITORS), and it's having an effect where items placed after it are hidden 50% of the time. It appears that in the chain of adding items to the menu, if menu items are placed after the reopenEditors then they are not visible on the first instance of clicking on the menu drop down, but will be visible on the next click, and not visible on the next click, and so on (I have attached a gif to display what I'm seeing). To test I've created a barebones RCP application [0] that simply adds a reopenEditors to the menu, and then adds an Exit action. [0] https://github.com/aptmac/rcp-hello-world/blob/master/src/org/eclipse/ui/tutorials/rcp/part1/ApplicationActionBarAdvisor.java#L36
Hi, I had the same issue that you reported. I suppose it might be related to the changes introduced with the following bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=530966). In our product all worked fine with platform based on Eclipse 4.7.3a, but not most recent ones. From my initial tests, I replaced the contribution line moving it to the top of the file menu creation similarly to what is done in the method org.eclipse.ui.internal.ide.WorkbenchActionBuilder#createFileMenu() This seems to solve the problem of intermittent showing.
Can you please push a Gerrit patch with the fix proposal?
The code I modified is in our class that extends ActionBarAdvisor. We simply moved the "recent files" menu creation to the beginning similar to what is done in the method org.eclipse.ui.internal.ide.WorkbenchActionBuilder#createFileMenu() These four lines of code: MenuManager recent = new MenuManager(WorkbenchMessages.OpenRecentDocuments_text); recent.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow())); recent.add(new GroupMarker(IWorkbenchActionConstants.MRU)); menu.add(recent); It appears that trying to put the list as flat is causing the issue in this position as well.