Action Reactoring (AbstractOperationAction)
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / actions / QuickdiffBaselineOperation.java
blobb957074ff788cc8b1c70d254a11ecf48dc5334de
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.io.IOException;
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.core.runtime.jobs.ISchedulingRule;
16 import org.eclipse.egit.ui.Activator;
17 import org.eclipse.egit.ui.UIText;
18 import org.eclipse.egit.ui.internal.decorators.GitQuickDiffProvider;
19 import org.eclipse.jgit.lib.Repository;
21 /**
22 * UI operation to change the git quickdiff baseline
24 public class QuickdiffBaselineOperation extends AbstractRevObjectOperation {
26 private final String baseline;
28 /**
29 * Construct a QuickdiffBaselineOperation for changing quickdiff baseline
30 * @param repository
32 * @param baseline
34 QuickdiffBaselineOperation(final Repository repository, final String baseline) {
35 super(repository);
36 this.baseline = baseline;
39 /* (non-Javadoc)
40 * @see org.eclipse.egit.core.op.IEGitOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
42 public void execute(IProgressMonitor monitor) throws CoreException {
43 try {
44 GitQuickDiffProvider.setBaselineReference(repository, baseline);
45 } catch (IOException e) {
46 Activator
47 .logError(
48 UIText.QuickdiffBaselineOperation_baseline,
49 e);
53 public ISchedulingRule getSchedulingRule() {
54 return null;