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

Bug 313573

Summary: [design] separator as first menu item is not hidden
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 RC2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 262603    
Attachments:
Description Flags
Fix holger.staudacher: review?, rsternberg: review+

Description Benjamin Muskalla CLA 2010-05-19 12:43:03 EDT
If you use a Separator as first item in the Menu, the design still shows the separator. In RCP / RAP without IAD, it is hidden. A use-case for this are the MB_ADDITIONS which often occur as first item in the menu.

  protected void fillMenuBar( final IMenuManager menuBar ) {
    MenuManager fileMenu = new MenuManager( "File",
                                            IWorkbenchActionConstants.M_FILE );
    menuBar.add( fileMenu );
    fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add( importAction );
    fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add( exportAction );
    fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add( exitAction );
  }
Comment 1 Holger Staudacher CLA 2010-05-20 10:29:28 EDT
Created attachment 169351 [details]
Fix

Checks if the first menuitem is a separator. If it's a separator than it's not added to the menu.
Comment 2 Ralf Sternberg CLA 2010-05-20 16:14:27 EDT
Comment on attachment 169351 [details]
Fix

the patch looks good for me
Comment 3 Holger Staudacher CLA 2010-05-21 03:56:01 EDT
Changes are in CVS HEAD. Thanks for reviewing.