Initial EGit contribution to eclipse.org
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / actions / HardResetToRevisionAction.java
blob13dab0600e19e3cf6e53fe10131a2554418fe134
1 /*******************************************************************************
2 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org.eclipse.egit.ui.internal.actions;
11 import java.util.List;
13 import org.eclipse.core.resources.IWorkspaceRunnable;
14 import org.eclipse.egit.core.op.ResetOperation;
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.jgit.lib.AnyObjectId;
18 /**
19 * Hard reset to selected revision
21 public class HardResetToRevisionAction extends AbstractRevObjectAction {
23 @Override
24 protected IWorkspaceRunnable createOperation(IAction act, List selection) {
25 return new ResetOperation(getActiveRepository(),
26 ((AnyObjectId) selection.get(0)).name(),
27 ResetOperation.ResetType.HARD);