diff options
author | Michael Valenta | 2007-07-11 14:59:34 +0000 |
---|---|---|
committer | Michael Valenta | 2007-07-11 14:59:34 +0000 |
commit | 3744aa5363ff8f7ac6d711aa8f390e19c491054a (patch) | |
tree | 202a8eda8b6698132d1d1f9a51054a3508346476 | |
parent | d0a2c4772ec041e02d84e89a55b0e855d2201fe6 (diff) | |
download | eclipse.platform.team-3744aa5363ff8f7ac6d711aa8f390e19c491054a.tar.gz eclipse.platform.team-3744aa5363ff8f7ac6d711aa8f390e19c491054a.tar.xz eclipse.platform.team-3744aa5363ff8f7ac6d711aa8f390e19c491054a.zip |
Bug 194130 [RCP] Compare should not add Team menu itemRoot_bug_193324
7 files changed, 13 insertions, 178 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java deleted file mode 100644 index 73eb80081..000000000 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.compare.internal.patch; - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.internal.*; -import org.eclipse.compare.patch.ApplyPatchOperation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - - -public class CompareWithPatchAction extends BaseCompareAction implements IObjectActionDelegate { - - - private IWorkbenchPart targetPart; - - protected boolean isEnabled(ISelection selection) { - return Utilities.getResources(selection).length == 1; - } - - /* (non-Javadoc) - * @see org.eclipse.compare.internal.BaseCompareAction#run(org.eclipse.jface.viewers.ISelection) - */ - protected void run(ISelection selection) { - IResource firstResource = Utilities.getFirstResource(selection); - - boolean isPatch = false; - if (firstResource instanceof IFile) { - try { - isPatch = ApplyPatchOperation.isPatch((IFile)firstResource); - } catch (CoreException e) { - CompareUIPlugin.log(e); - } - } - - final ApplyPatchOperation patchOp; - if (isPatch) { - patchOp= new ApplyPatchOperation(targetPart, (IFile)firstResource, null, new CompareConfiguration()); - } else { - patchOp= new ApplyPatchOperation(targetPart, firstResource); - } - - targetPart.getSite().getShell().getDisplay().asyncExec(new Runnable(){ - public void run() { - BusyIndicator.showWhile(targetPart.getSite().getShell().getDisplay(), patchOp); - } - }); - - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - this.targetPart = targetPart; - } -} diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties index e54ba7e1b..877d29609 100644 --- a/bundles/org.eclipse.compare/plugin.properties +++ b/bundles/org.eclipse.compare/plugin.properties @@ -83,11 +83,6 @@ CompareWithMenu.label= Comp&are With CompareWithEachOtherAction.label= &Each Other CompareWithEachOtherAction.tooltip= Compare the Selected Resources -TeamMenu.label= T&eam - -CompareWithPatchAction.label= &Apply Patch... -CompareWithPatchAction.tooltip= Apply a Patch to the Selected Resources - CompareWithHistoryAction.label= &Local History... CompareWithHistoryAction.tooltip= Compare the Selected Resource with Local History diff --git a/bundles/org.eclipse.compare/plugin.xml b/bundles/org.eclipse.compare/plugin.xml index a2cc8ad49..0a0ab38ca 100644 --- a/bundles/org.eclipse.compare/plugin.xml +++ b/bundles/org.eclipse.compare/plugin.xml @@ -188,14 +188,6 @@ name="compareWithGroup"> </separator> </menu> - <menu - label="%TeamMenu.label" - path="additions" - id="team.main"> - <separator - name="group1"> - </separator> - </menu> </objectContribution> <objectContribution objectClass="org.eclipse.core.resources.IResource" @@ -209,14 +201,6 @@ enablesFor="2+" id="compareWithEachOther"> </action> - <action - label="%CompareWithPatchAction.label" - tooltip="%CompareWithPatchAction.tooltip" - class="org.eclipse.compare.internal.patch.CompareWithPatchAction" - menubarPath="team.main/group1" - enablesFor="1" - id="compareWithPatch"> - </action> </objectContribution> <objectContribution objectClass="org.eclipse.core.resources.IFile" diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java deleted file mode 100644 index 73eb80081..000000000 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/CompareWithPatchAction.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.compare.internal.patch; - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.internal.*; -import org.eclipse.compare.patch.ApplyPatchOperation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - - -public class CompareWithPatchAction extends BaseCompareAction implements IObjectActionDelegate { - - - private IWorkbenchPart targetPart; - - protected boolean isEnabled(ISelection selection) { - return Utilities.getResources(selection).length == 1; - } - - /* (non-Javadoc) - * @see org.eclipse.compare.internal.BaseCompareAction#run(org.eclipse.jface.viewers.ISelection) - */ - protected void run(ISelection selection) { - IResource firstResource = Utilities.getFirstResource(selection); - - boolean isPatch = false; - if (firstResource instanceof IFile) { - try { - isPatch = ApplyPatchOperation.isPatch((IFile)firstResource); - } catch (CoreException e) { - CompareUIPlugin.log(e); - } - } - - final ApplyPatchOperation patchOp; - if (isPatch) { - patchOp= new ApplyPatchOperation(targetPart, (IFile)firstResource, null, new CompareConfiguration()); - } else { - patchOp= new ApplyPatchOperation(targetPart, firstResource); - } - - targetPart.getSite().getShell().getDisplay().asyncExec(new Runnable(){ - public void run() { - BusyIndicator.showWhile(targetPart.getSite().getShell().getDisplay(), patchOp); - } - }); - - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - this.targetPart = targetPart; - } -} diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties index e54ba7e1b..877d29609 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties @@ -83,11 +83,6 @@ CompareWithMenu.label= Comp&are With CompareWithEachOtherAction.label= &Each Other CompareWithEachOtherAction.tooltip= Compare the Selected Resources -TeamMenu.label= T&eam - -CompareWithPatchAction.label= &Apply Patch... -CompareWithPatchAction.tooltip= Apply a Patch to the Selected Resources - CompareWithHistoryAction.label= &Local History... CompareWithHistoryAction.tooltip= Compare the Selected Resource with Local History diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml index a2cc8ad49..0a0ab38ca 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml @@ -188,14 +188,6 @@ name="compareWithGroup"> </separator> </menu> - <menu - label="%TeamMenu.label" - path="additions" - id="team.main"> - <separator - name="group1"> - </separator> - </menu> </objectContribution> <objectContribution objectClass="org.eclipse.core.resources.IResource" @@ -209,14 +201,6 @@ enablesFor="2+" id="compareWithEachOther"> </action> - <action - label="%CompareWithPatchAction.label" - tooltip="%CompareWithPatchAction.tooltip" - class="org.eclipse.compare.internal.patch.CompareWithPatchAction" - menubarPath="team.main/group1" - enablesFor="1" - id="compareWithPatch"> - </action> </objectContribution> <objectContribution objectClass="org.eclipse.core.resources.IFile" diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml index ffc8f681e..3e9223363 100644 --- a/bundles/org.eclipse.team.ui/plugin.xml +++ b/bundles/org.eclipse.team.ui/plugin.xml @@ -155,6 +155,19 @@ overrideActionId="replaceFromHistory" tooltip="%ReplaceLocalHistory.tooltip"/> </objectContribution> + <objectContribution + objectClass="org.eclipse.core.resources.IResource" + adaptable="true" + id="org.eclipse.team.ui.ResourceContributions"> + <action + label="%ApplyPatch.label" + tooltip="%ApplyPatch.tooltip" + class="org.eclipse.team.internal.ui.actions.ApplyPatchAction" + menubarPath="team.main/group1" + enablesFor="*" + id="org.eclipse.team.ui.applyPatch"> + </action> + </objectContribution> </extension> <!-- ************** Views ********************** --> <extension |