newMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.element" ) ); contributeActionsToMenu( newMenu, elementActions );  MenuManager InsertGroupMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.element.group" ),InsertGroupMenuAction.ID ); InsertGroupMenu.add( NoneAction.getInstance( ) ); InsertGroupMenu.addMenuListener( new IMenuListener( ) {
MenuManager elementMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.element" ), M_ELEMENT ); contributeActionsToMenu( elementMenu, elementActions );  MenuManager insertGroupMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.element.group" ), InsertGroupMenuAction.ID ); insertGroupMenu.add( NoneAction.getInstance( ) ); insertGroupMenu.addMenuListener( new IMenuListener( ) {
	public void contributeToMenu( IMenuManager menubar )	{		super.contributeToMenu( menubar );		updateEditMenu( menubar );		// Data Menu		MenuManager newMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.data" ) ); //$NON-NLS-1$		newMenu.add( getAction( dataActions[0].id ) );		newMenu.add( getAction( dataActions[1].id ) );		MenuManager editGroupMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.data-NewParameter" ) ); //$NON-NLS-1$		contributeActionsToMenu( editGroupMenu, parameterActions );		// Add new parameter action		newMenu.add( editGroupMenu );		menubar.insertAfter( IWorkbenchActionConstants.M_EDIT, newMenu );		// Element Menu		newMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.element" ) ); //$NON-NLS-1$		contributeActionsToMenu( newMenu, elementActions );				MenuManager InsertGroupMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.element.group" ),InsertGroupMenuAction.ID ); //$NON-NLS-1$		InsertGroupMenu.add( NoneAction.getInstance( ) );		InsertGroupMenu.addMenuListener( new IMenuListener( ) {			public void menuAboutToShow( IMenuManager manager )			{				updateInsertGroupMenu( InsertGroupMenuAction.ID, manager );			}		} );		newMenu.add( InsertGroupMenu );						editGroupMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.element-EditGroup" ) ); //$NON-NLS-1$		editGroupMenu.add( NoneAction.getInstance( ) );		editGroupMenu.addMenuListener( new IMenuListener( ) {			public void menuAboutToShow( IMenuManager manager )			{				updateDynamicItems( EditGroupMenuAction.ID, manager );			}		} );		newMenu.add( editGroupMenu );		newMenu.add( new Separator( ) );		contributeStyleMenu( newMenu );		newMenu.addMenuListener( new IMenuListener( ) {			public void menuAboutToShow( IMenuManager manager )			{				IContributionItem addGroupMenu = manager.findUsingPath( AddGroupAction.ID );				IContributionItem insertGroupMenus = manager.findUsingPath( InsertGroupMenuAction.ID );						if(addGroupMenu == null || insertGroupMenus == null)				{					return;				}				RetargetAction action = (RetargetAction) getAction( AddGroupAction.ID );				if ( action != null						&& action.getActionHandler( ) instanceof AddGroupAction )				{					if(action.getActionHandler( ).isEnabled( ))					{												addGroupMenu.setVisible( true );						insertGroupMenus.setVisible( false );					}else					{						addGroupMenu.setVisible( false );						insertGroupMenus.setVisible( true );																	}					manager.update( true );				}			}		} );		menubar.insertAfter( IWorkbenchActionConstants.M_EDIT, newMenu );		// Page Menu		menubar.insertAfter( IWorkbenchActionConstants.M_EDIT, createPageMenu( ) );		// Insert Menu		newMenu = new MenuManager( Messages.getString( "DesignerActionBarContributor.menu.insert" ) ); //$NON-NLS-1$		contributeActionsToMenu( newMenu, getInsertElementActions( ) );		newMenu.add( new Separator( ) );		newMenu.add( getAction( ImportLibraryAction.ID ) );		menubar.insertAfter( IWorkbenchActionConstants.M_EDIT, newMenu );		menubar.update( );	}