Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: a56f55d249ea30c77ee957f1ea55709ef69b0e59 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
  
                                                                     







                                                                        
                                                    


                                             
                                          





















                                                                     




                                                           




                                                  


                                            


                                                                                      



                                

   
/*
 * Copyright (c) 2011-2013 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.explorer.ui.application;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;

/**
 * @author Eike Stepper
 */
public class CDOExplorerActionBarAdvisor extends ActionBarAdvisor
{
  private IWorkbenchAction introAction;

  public CDOExplorerActionBarAdvisor(IActionBarConfigurer configurer)
  {
    super(configurer);
  }

  @Override
  protected void makeActions(IWorkbenchWindow window)
  {
    if (window.getWorkbench().getIntroManager().hasIntro())
    {
      introAction = ActionFactory.INTRO.create(window);
      register(introAction);
    }
  }

  @Override
  protected void fillMenuBar(IMenuManager menuBar)
  {
    menuBar.add(new Separator("additions"));

    // Help
    MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
    menuBar.add(helpMenu);

    if (introAction != null)
    {
      helpMenu.add(introAction);
    }
  }
}

Back to the top