/******************************************************************************* * Copyright (c) 2007 Spring IDE Developers * 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: * Spring IDE Developers - initial API and implementation *******************************************************************************/ package org.springframework.ide.eclipse.webflow.ui.graph.actions; import org.eclipse.gef.editparts.ZoomManager; import org.eclipse.gef.ui.actions.ActionBarContributor; import org.eclipse.gef.ui.actions.DeleteRetargetAction; 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.IToolBarManager; import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.part.EditorActionBarContributor; /** * @author Christian Dupuis */ public class WebflowActionBarContributor extends ActionBarContributor { /** * * * @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions() */ protected void buildActions() { addRetargetAction(new UndoRetargetAction()); addRetargetAction(new RedoRetargetAction()); addRetargetAction(new DeleteRetargetAction()); addRetargetAction(new ZoomInRetargetAction()); addRetargetAction(new ZoomOutRetargetAction()); addRetargetAction(new ExportRetargetAction()); } /** * * * @param toolBarManager * * @see EditorActionBarContributor#contributeToToolBar(IToolBarManager) */ public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(getAction(ActionFactory.UNDO.getId())); toolBarManager.add(getAction(ActionFactory.REDO.getId())); toolBarManager.add(getAction(ExportAction.ID)); String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH }; toolBarManager .add(new ZoomComboContributionItem(getPage(), zoomStrings)); } /** * * * @see org.eclipse.gef.ui.actions.ActionBarContributor#declareGlobalActionKeys() */ protected void declareGlobalActionKeys() { addGlobalActionKey(ActionFactory.PRINT.getId()); addGlobalActionKey(ActionFactory.SELECT_ALL.getId()); } }