Package org.springframework.ide.eclipse.beans.ui.graph.actions

Source Code of org.springframework.ide.eclipse.beans.ui.graph.actions.GraphActionBarContributor

/*******************************************************************************
* Copyright (c) 2004, 2008 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.beans.ui.graph.actions;

import org.eclipse.gef.editparts.ZoomManager;
import org.eclipse.gef.ui.actions.ActionBarContributor;
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;

/**
* @author Torsten Juergeleit
* @author Christian Dupuis
*/
public class GraphActionBarContributor extends ActionBarContributor {

  @Override
  protected void buildActions() {
    addRetargetAction(new ZoomInRetargetAction());
    addRetargetAction(new ZoomOutRetargetAction());
    addRetargetAction(new ExportRetargetAction());
  }

  @Override
  protected void declareGlobalActionKeys() {
    addGlobalActionKey(ActionFactory.PRINT.getId());
  }

  @Override
  public void contributeToToolBar(IToolBarManager manager) {
    String[] zoomStrings = new String[] { ZoomManager.FIT_ALL,
                ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
    manager.add(new ZoomComboContributionItem(getPage(), zoomStrings));
    manager.add(getAction(ExportAction.ID));
  }
}
TOP

Related Classes of org.springframework.ide.eclipse.beans.ui.graph.actions.GraphActionBarContributor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.