2 * Copyright (C) 2006 Robin Rosenberg
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License, version 2.1, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org
.spearce
.egit
.ui
.internal
.actions
;
19 import java
.util
.Arrays
;
20 import java
.util
.Hashtable
;
22 import org
.eclipse
.core
.resources
.IResource
;
23 import org
.eclipse
.jface
.action
.IAction
;
24 import org
.eclipse
.swt
.widgets
.Shell
;
25 import org
.eclipse
.team
.internal
.ui
.actions
.TeamAction
;
26 import org
.eclipse
.team
.ui
.TeamUI
;
27 import org
.eclipse
.team
.ui
.history
.HistoryPageSaveablePart
;
29 public class CompareWithRevisionAction
extends TeamAction
{
31 public void execute(IAction action
) {
33 System
.out
.println("Run:" + action
);
34 System
.out
.println("Selection resources:"
35 + Arrays
.asList(getSelectedResources()));
36 IResource
[] r
= getSelectedResources();
37 Hashtable providerMapping
= this.getProviderMapping(r
);
38 System
.out
.println("Mapping:" + providerMapping
);
39 TeamUI
.getHistoryView().showHistoryFor(getSelectedResources()[0]);
43 protected void showCompareInDialog(Shell shell
, Object object
) {
44 HistoryPageSaveablePart
.showHistoryInDialog(shell
, object
);
47 public boolean isEnabled() {
48 return !getSelection().isEmpty();