Remove System.out.println from RevWalkFilterTest
[jgit.git] / org.spearce.egit.ui / src / org / spearce / egit / ui / internal / actions / ShowResourceInHistoryAction.java
blob0e7f846cfbcfb7da4fccdea969583685e9391bcf
1 /*******************************************************************************
2 * Copyright (C) 2007, David Watson <dwatson@mimvista.com>
3 * Copyright (C) 2007, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
4 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
5 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
7 * All rights reserved. This program and the accompanying materials
8 * are made available under the terms of the Eclipse Public License v1.0
9 * See LICENSE for the full license text, also available.
10 *******************************************************************************/
11 package org.spearce.egit.ui.internal.actions;
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.swt.widgets.Shell;
15 import org.eclipse.team.internal.ui.actions.TeamAction;
16 import org.eclipse.team.ui.TeamUI;
17 import org.eclipse.team.ui.history.HistoryPageSaveablePart;
18 import org.spearce.egit.core.ResourceList;
20 /**
21 * An action to update the history view for the selected
22 * resource. If the history view is not visible it will be
23 * shown.
25 public class ShowResourceInHistoryAction extends TeamAction {
27 // There are changes in Eclipse 3.3 requiring that execute be implemented
28 // for it to compile. while 3.2 requires that run is implemented instead.
29 /**
30 * See {@link #run}
32 * @param action
34 public void execute(IAction action) {
35 run(action);
38 @Override
39 public void run(IAction action) {
40 TeamUI.getHistoryView().showHistoryFor(
41 new ResourceList(getSelectedResources()));
44 void showCompareInDialog(Shell shell, Object object) {
45 HistoryPageSaveablePart.showHistoryInDialog(shell, object);
48 public boolean isEnabled() {
49 return !getSelection().isEmpty();