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 * which accompanies this distribution, and is available at
10 * http://www.eclipse.org/legal/epl-v10.html
11 *******************************************************************************/
12 package org
.eclipse
.egit
.ui
.internal
.actions
;
14 import org
.eclipse
.egit
.core
.ResourceList
;
15 import org
.eclipse
.jface
.action
.IAction
;
16 import org
.eclipse
.swt
.widgets
.Shell
;
17 import org
.eclipse
.team
.internal
.ui
.actions
.TeamAction
;
18 import org
.eclipse
.team
.ui
.TeamUI
;
19 import org
.eclipse
.team
.ui
.history
.HistoryPageSaveablePart
;
22 * An action to update the history view for the selected
23 * resource. If the history view is not visible it will be
26 public class ShowResourceInHistoryAction
extends TeamAction
{
28 // There are changes in Eclipse 3.3 requiring that execute be implemented
29 // for it to compile. while 3.2 requires that run is implemented instead.
35 public void execute(IAction action
) {
40 public void run(IAction action
) {
41 TeamUI
.getHistoryView().showHistoryFor(
42 new ResourceList(getSelectedResources()));
45 void showCompareInDialog(Shell shell
, Object object
) {
46 HistoryPageSaveablePart
.showHistoryInDialog(shell
, object
);
49 public boolean isEnabled() {
50 return !getSelection().isEmpty();