diff options
| author | Mihael Vrbanec | 2009-12-02 12:41:12 +0000 |
|---|---|---|
| committer | Robin Rosenberg | 2009-12-30 00:16:45 +0000 |
| commit | 1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771 (patch) | |
| tree | 7fbaa5110f6fbd9ee84b1439d02c19cf32a4660d | |
| parent | 2c13813e93ca6f091f801b03c451943766f05c86 (diff) | |
| download | egit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.tar.gz egit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.tar.xz egit-1bb0e209f0fc399e4e37e7fc4f3ee2813f4b6771.zip | |
Implement "Compare with Revision" action.
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.properties | 4 | ||||
| -rw-r--r-- | org.eclipse.egit.ui/plugin.xml | 11 | ||||
| -rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRevisionAction.java | 19 |
3 files changed, 13 insertions, 21 deletions
diff --git a/org.eclipse.egit.ui/plugin.properties b/org.eclipse.egit.ui/plugin.properties index 040c723a94..83fc8a416c 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 8e2d8b4d5b..4f48e1c040 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 218c5e9125..0576a0df43 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(); } - } |
