/* * Copyright (c) 2006, 2007 Borland Software Corporation. * 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: * Richard Gronback (Borland) - initial API and implementation */ package org.eclipse.gmf.examples.mindmap.rcp.part; import org.eclipse.gef.ui.actions.ActionBarContributor; import org.eclipse.gef.ui.actions.DeleteRetargetAction; import org.eclipse.gef.ui.actions.GEFActionConstants; import org.eclipse.gef.ui.actions.RedoRetargetAction; import org.eclipse.gef.ui.actions.UndoRetargetAction; import org.eclipse.gef.ui.actions.ZoomComboContributionItem; import org.eclipse.gef.ui.actions.ZoomInRetargetAction; import org.eclipse.gef.ui.actions.ZoomOutRetargetAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.actions.ActionFactory; /** * The action bar contributor for the Mindmap editor. * @generated */ public class MindmapDiagramActionBarContributor extends ActionBarContributor { /** * @generated */ protected void buildActions() { addRetargetAction(new UndoRetargetAction()); addRetargetAction(new RedoRetargetAction()); addRetargetAction(new DeleteRetargetAction()); addRetargetAction(new ZoomInRetargetAction()); addRetargetAction(new ZoomOutRetargetAction()); } /** * @generated */ protected void declareGlobalActionKeys() { addGlobalActionKey(ActionFactory.PRINT.getId()); addGlobalActionKey(ActionFactory.DELETE.getId()); } /** * @generated */ public void contributeToMenu(IMenuManager menuManager) { super.contributeToMenu(menuManager); // add a "View" menu after "Edit" MenuManager viewMenu = new MenuManager( Messages.MindmapDiagramActionBarContributor_viewMenu); viewMenu.add(getAction(GEFActionConstants.ZOOM_IN)); viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT)); menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu); } /** * @generated */ public void contributeToToolBar(IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); toolBarManager.add(getAction(ActionFactory.UNDO.getId())); toolBarManager.add(getAction(ActionFactory.REDO.getId())); toolBarManager.add(new Separator()); toolBarManager.add(new ZoomComboContributionItem(getPage())); } }