Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 409124

Summary: [Menu] Item is inserted in wrong position from dynamic ContributionItem
Product: [RT] RAP Reporter: Yury <swimmer_86>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
DemoActionBarAdvisor.patch
none
Proposed patch tbuschto: review+

Description Yury CLA 2013-05-27 05:16:29 EDT
Created attachment 231534 [details]
DemoActionBarAdvisor.patch

Problem is discussed here - http://www.eclipse.org/forums/index.php/t/487961/.

Menu items have a wrong order for some cases.

Steps to reproduce:
1. Apply the attached patch (DemoActionBarAdvisor.patch) to org.eclipse.rap.demo.
2. Open the workbench and open About dialog (Help->About).
3. Open File menu - 

the "New MenuItem" is the first menu item there, but it was inserted on the second position. 

If you change the ContributionItem.isDynamic to return false - the item will be inserted correctly.
Comment 1 Ivan Furnadjiev CLA 2013-05-27 05:57:01 EDT
Created attachment 231538 [details]
Proposed patch

This patch checks for _preItem in Menu.js#addMenuItemAt.
Comment 2 Tim Buschtoens CLA 2013-05-27 06:04:31 EDT
Comment on attachment 231538 [details]
Proposed patch

+1
Changes look good, risk is low.
Comment 3 Ivan Furnadjiev CLA 2013-05-27 06:12:22 EDT
Applied patch with commit 74258680fcce9d855ad376f2525296ef3fa31d46.