bug 316875: [backport] Commit, Apply Patch and Synchronize no longer take keybindings
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 2b649fd..9d03bf2 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -1238,10 +1238,11 @@
description="%CVSActionSet.checkoutTooltip"
id="org.eclipse.team.cvs.ui.checkout"/>
<command
- description="%CommitAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%CommitAction.name"
- id="org.eclipse.team.cvs.ui.commit"/>
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
+ description="%CommitAction.tooltip"
+ id="org.eclipse.team.cvs.ui.commit"
+ name="%CommitAction.name"/>
<command
description="%CommitAllAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
@@ -1249,74 +1250,87 @@
id="org.eclipse.team.cvs.ui.commitAll"/>
<command
categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction"
description="%ReplaceWithAction.tooltip"
- name="%ReplaceWithAction.name"
- id="org.eclipse.team.cvs.ui.replace"/>
+ id="org.eclipse.team.cvs.ui.replace"
+ name="%ReplaceWithAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithSelectableTagAction"
description="%ReplaceWithTagAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%ReplaceWithTagAction.name"
- id="org.eclipse.team.cvs.ui.replaceWithTag"/>
+ id="org.eclipse.team.cvs.ui.replaceWithTag"
+ name="%ReplaceWithTagAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRevisionAction"
description="%ReplaceWithRevisionAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%ReplaceWithRevisionAction.name"
- id="org.eclipse.team.cvs.ui.replaceWithRevision"/>
+ id="org.eclipse.team.cvs.ui.replaceWithRevision"
+ name="%ReplaceWithRevisionAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRemoteAction"
description="%CompareWithRemoteAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%CompareWithRemoteAction.name"
- id="org.eclipse.team.cvs.ui.compareWithRemote"/>
+ id="org.eclipse.team.cvs.ui.compareWithRemote"
+ name="%CompareWithRemoteAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithTagAction"
description="%CompareWithTagAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%CompareWithTagAction.name"
- id="org.eclipse.team.cvs.ui.compareWithTag"/>
+ id="org.eclipse.team.cvs.ui.compareWithTag"
+ name="%CompareWithTagAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction"
description="%CompareWithRevisionAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%CompareWithRevisionAction.name"
- id="org.eclipse.team.cvs.ui.compareWithRevision"/>
+ id="org.eclipse.team.cvs.ui.compareWithRevision"
+ name="%CompareWithRevisionAction.name"/>
<command
- description="%UpdateAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%UpdateAction.name"
- id="org.eclipse.team.cvs.ui.update"/>
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.UpdateSilentAction"
+ description="%UpdateAction.tooltip"
+ id="org.eclipse.team.cvs.ui.update"
+ name="%UpdateAction.name"/>
<command
description="%UpdateAllAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
id="org.eclipse.team.cvs.ui.updateAll"
name="%UpdateAllAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
description="%GenerateDiff.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%GenerateDiff.name"
- id="org.eclipse.team.cvs.ui.GenerateDiff"/>
+ id="org.eclipse.team.cvs.ui.GenerateDiff"
+ name="%GenerateDiff.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction"
description="%TagAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%TagAction.name"
- id="org.eclipse.team.cvs.ui.tag"/>
+ id="org.eclipse.team.cvs.ui.tag"
+ name="%TagAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
description="%BranchAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%BranchAction.name"
- id="org.eclipse.team.cvs.ui.branch"/>
+ id="org.eclipse.team.cvs.ui.branch"
+ name="%BranchAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.MergeAction"
description="%MergeAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%MergeAction.name"
- id="org.eclipse.team.cvs.ui.merge"/>
+ id="org.eclipse.team.cvs.ui.merge"
+ name="%MergeAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction"
description="%UpdateActionSwitch.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%UpdateActionSwitch.name"
- id="org.eclipse.team.cvs.ui.updateSwitch"/>
+ id="org.eclipse.team.cvs.ui.updateSwitch"
+ name="%UpdateActionSwitch.name"/>
<command
- description="%SetKeywordSubstitutionAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%SetKeywordSubstitutionAction.name"
- id="org.eclipse.team.cvs.ui.setKeywordSubstitution"/>
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction"
+ description="%SetKeywordSubstitutionAction.tooltip"
+ id="org.eclipse.team.cvs.ui.setKeywordSubstitution"
+ name="%SetKeywordSubstitutionAction.name"/>
<command
description="%ShowAnnotationAction.tooltip"
categoryId="org.eclipse.team.cvs.ui.actionSet"
@@ -1330,20 +1344,23 @@
defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
id="org.eclipse.team.cvs.ui.showHistory"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
description="%AddAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%AddAction.name"
- id="org.eclipse.team.cvs.ui.add"/>
+ id="org.eclipse.team.cvs.ui.add"
+ name="%AddAction.name"/>
<command
+ categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
description="%IgnoreAction.tooltip"
- categoryId="org.eclipse.team.cvs.ui.actionSet"
- name="%IgnoreAction.name"
- id="org.eclipse.team.cvs.ui.ignore"/>
+ id="org.eclipse.team.cvs.ui.ignore"
+ name="%IgnoreAction.name"/>
<command
categoryId="org.eclipse.team.cvs.ui.actionSet"
+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.SyncAction"
description="%Synchronize.tooltip"
- name="%Synchronize.name"
- id="org.eclipse.team.cvs.ui.sync"/>
+ id="org.eclipse.team.cvs.ui.sync"
+ name="%Synchronize.name"/>
</extension>
<!-- Commented out awaiting menu support from UI
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
index c69fa97..3558137 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
@@ -12,14 +12,11 @@
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry;
@@ -27,9 +24,6 @@
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.operations.ShowAnnotationOperation;
-import org.eclipse.ui.*;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.ide.ResourceUtil;
public class ShowAnnotationAction extends WorkspaceAction {
@@ -161,40 +155,4 @@
public String getId() {
return ICVSUIConstants.CMD_ANNOTATE;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
- */
- public void setEnabled(Object evaluationContext) {
- IWorkbenchWindow activeWorkbenchWindow = (IWorkbenchWindow) HandlerUtil
- .getVariable(evaluationContext,
- ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- if (activeWorkbenchWindow != null) {
- ISelection selection = (ISelection) HandlerUtil.getVariable(
- evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
- if (selection == null) {
- selection = StructuredSelection.EMPTY;
- }
- IWorkbenchPart part = (IWorkbenchPart) HandlerUtil.getVariable(
- evaluationContext, ISources.ACTIVE_PART_NAME);
- updateSelection(activeWorkbenchWindow, part, selection);
- }
- }
-
- private void updateSelection(IWorkbenchWindow activeWorkbenchWindow,
- IWorkbenchPart part, ISelection selection) {
- // If the action is run from within an editor, try and find the
- // file for the given editor.
- setActivePart(null, part);
- if (part != null && part instanceof IEditorPart) {
- IEditorInput input = ((IEditorPart) part).getEditorInput();
- IFile file = ResourceUtil.getFile(input);
- if (file != null) {
- selectionChanged((IAction) null, new StructuredSelection(file));
- }
- } else {
- // Fallback is to prime the action with the selection
- selectionChanged((IAction) null, selection);
- }
- }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
index 881f2ff..839b1e9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
@@ -12,22 +12,16 @@
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.ui.*;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.ide.ResourceUtil;
public class ShowResourceInHistoryAction extends WorkspaceAction {
/*
@@ -92,39 +86,4 @@
protected boolean isEnabledForIgnoredResources() {
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
- */
- public void setEnabled(Object evaluationContext) {
- IWorkbenchWindow activeWorkbenchWindow = (IWorkbenchWindow) HandlerUtil
- .getVariable(evaluationContext,
- ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- if (activeWorkbenchWindow != null) {
- ISelection selection = (ISelection) HandlerUtil.getVariable(
- evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
- if (selection == null) {
- selection = StructuredSelection.EMPTY;
- }
- IWorkbenchPart part = (IWorkbenchPart) HandlerUtil.getVariable(
- evaluationContext, ISources.ACTIVE_PART_NAME);
- updateSelection(activeWorkbenchWindow, part, selection);
- }
- }
-
- private void updateSelection(IWorkbenchWindow activeWorkbenchWindow,
- IWorkbenchPart part, ISelection selection) {
- // If the action is run from within an editor, try and find the
- // file for the given editor.
- if (part != null && part instanceof IEditorPart) {
- IEditorInput input = ((IEditorPart) part).getEditorInput();
- IFile file = ResourceUtil.getFile(input);
- if (file != null) {
- selectionChanged((IAction) null, new StructuredSelection(file));
- }
- } else {
- // Fallback is to prime the action with the selection
- selectionChanged((IAction) null, selection);
- }
- }
}
diff --git a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
index e8ba30b..d533263 100644
--- a/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.ui; singleton:=true
-Bundle-Version: 3.5.100.qualifier
+Bundle-Version: 3.5.101.qualifier
Bundle-Activator: org.eclipse.team.internal.ui.TeamUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 92b8c8a..b51cd55 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -329,10 +329,11 @@
id="org.eclipse.team.ui.synchronizeLast">
</command>
<command
- name="%Command.applyPatch.name"
categoryId="org.eclipse.team.ui.category.team"
+ defaultHandler="org.eclipse.team.internal.ui.actions.ApplyPatchAction"
description="%Command.applyPatch.description"
- id="org.eclipse.team.ui.applyPatch">
+ id="org.eclipse.team.ui.applyPatch"
+ name="%Command.applyPatch.name">
</command>
<command
name="%Synchronizing.perspective"
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
index fffc674..2863370 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,8 @@
import org.eclipse.core.commands.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.resources.mapping.ResourceMapping;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
@@ -211,7 +212,7 @@
private Object getResourceMapping(Object object) {
if (object instanceof ResourceMapping)
- return (ResourceMapping)object;
+ return object;
return Utils.getResourceMapping(object);
}
@@ -548,4 +549,39 @@
run(action);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
+ */
+ public void setEnabled(Object evaluationContext) {
+ IWorkbenchWindow activeWorkbenchWindow = (IWorkbenchWindow) HandlerUtil
+ .getVariable(evaluationContext,
+ ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
+ if (activeWorkbenchWindow != null) {
+ ISelection selection = (ISelection) HandlerUtil.getVariable(
+ evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ if (selection == null) {
+ selection = StructuredSelection.EMPTY;
+ }
+ IWorkbenchPart part = (IWorkbenchPart) HandlerUtil.getVariable(
+ evaluationContext, ISources.ACTIVE_PART_NAME);
+ updateSelection(part, selection);
+ }
+ }
+
+ private void updateSelection(IWorkbenchPart part, ISelection selection) {
+ // If the action is run from within an editor, try and find the
+ // file for the given editor.
+ setActivePart(null, part);
+ if (part != null && part instanceof IEditorPart) {
+ IEditorInput input = ((IEditorPart) part).getEditorInput();
+ IFile file = ResourceUtil.getFile(input);
+ if (file != null) {
+ selectionChanged((IAction) null, new StructuredSelection(file));
+ }
+ } else {
+ // Fallback is to prime the action with the selection
+ selectionChanged((IAction) null, selection);
+ }
+ }
+
}