aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMihael Vrbanec2009-12-02 07:41:12 (EST)
committerRobin Rosenberg2009-12-29 19:16:45 (EST)
commit1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771 (patch)
tree7fbaa5110f6fbd9ee84b1439d02c19cf32a4660d
parent2c13813e93ca6f091f801b03c451943766f05c86 (diff)
downloadegit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.zip
egit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.tar.gz
egit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.tar.bz2
Implement "Compare with Revision" action.refs/changes/21/121/4
Make labels translateable and match the cvs plugin Only show the action when one file is selected because it makes no sense otherwise. Signed-off-by: Stefan Lay <stefan.lay@sap.com> Change-Id: I50f1287b72aca6defc044a8dd47b233d8c3a40e3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
-rw-r--r--org.eclipse.egit.ui/plugin.properties4
-rw-r--r--org.eclipse.egit.ui/plugin.xml11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java19
3 files changed, 13 insertions, 21 deletions
diff --git a/org.eclipse.egit.ui/plugin.properties b/org.eclipse.egit.ui/plugin.properties
index 040c723..83fc8a4 100644
--- a/org.eclipse.egit.ui/plugin.properties
+++ b/org.eclipse.egit.ui/plugin.properties
@@ -37,8 +37,8 @@ UpdateAction_tooltip=Update Git's index with current version
Decorator_name=Git
Decorator_description=Shows Git specific information on resources in projects under version control.
-CompareWithRevisionAction_label=Compare With Git Revision
-CompareWithRevisionAction_tooltip=Compare With a Git Revision
+CompareWithRevisionAction_label=History...
+CompareWithRevisionAction_tooltip=Compare with the resource history
CompareWithIndexAction_label=Git Index
CompareWithIndexAction_tooltip=Compare with Git's index version
diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml
index 8e2d8b4..4f48e1c 100644
--- a/org.eclipse.egit.ui/plugin.xml
+++ b/org.eclipse.egit.ui/plugin.xml
@@ -170,6 +170,17 @@
menubarPath="additions">
</action>
</objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.egit.ui.fileContributions"
+ objectClass="org.eclipse.core.resources.IFile">
+ <action
+ class="org.eclipse.egit.ui.internal.actions.CompareWithRevisionAction"
+ id="org.eclipse.egit.ui.internal.actions.CompareWithRevisionAction"
+ label="%CompareWithRevisionAction_label"
+ menubarPath="compareWithMenu/gitCompareWithGroup"
+ tooltip="%CompareWithRevisionAction_tooltip" />
+ </objectContribution>
</extension>
<extension
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java
index 218c5e9..0576a0d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java
@@ -10,15 +10,9 @@
*******************************************************************************/
package org.eclipse.egit.ui.internal.actions;
-import java.util.Arrays;
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.history.HistoryPageSaveablePart;
/**
* Compare the resources filtered in the history view with the current
@@ -37,23 +31,10 @@ public class CompareWithRevisionAction extends TeamAction {
@Override
public void run(IAction action) {
- super.run(action);
- System.out.println("Run:" + action); //$NON-NLS-1$
- System.out.println("Selection resources:" //$NON-NLS-1$
- + Arrays.asList(getSelectedResources()));
- IResource[] r = getSelectedResources();
- Hashtable providerMapping = this.getProviderMapping(r);
- System.out.println("Mapping:" + providerMapping); //$NON-NLS-1$
TeamUI.getHistoryView().showHistoryFor(getSelectedResources()[0]);
-
- }
-
- void showCompareInDialog(Shell shell, Object object) {
- HistoryPageSaveablePart.showHistoryInDialog(shell, object);
}
public boolean isEnabled() {
return !getSelection().isEmpty();
}
-
}