Package ch.fusun.baron.map.ui.handlers

Source Code of ch.fusun.baron.map.ui.handlers.TurnMapHandlerCounterClockWise

package ch.fusun.baron.map.ui.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;

import ch.fusun.baron.map.ui.views.MapView;

/**
* Turns map counterclockwise
*/
public class TurnMapHandlerCounterClockWise extends AbstractHandler implements
    IHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil
        .getActiveWorkbenchWindowChecked(event);
    IViewPart view = window.getActivePage().findView(MapView.ID);
    if (view instanceof MapView) {
      ((MapView) view).turnCounterClockWise();
    }
    return null;
  }

}
TOP

Related Classes of ch.fusun.baron.map.ui.handlers.TurnMapHandlerCounterClockWise

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.