blob: 9e62e4c39bf91b4e00f4a049288631a4cb1ed5e4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/*
* 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.internal.explorer;
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);
}
}
}
|