diff options
author | Michael Valenta | 2006-10-26 13:38:39 +0000 |
---|---|---|
committer | Michael Valenta | 2006-10-26 13:38:39 +0000 |
commit | 11a5ccdf45223eae40f83dbbb9cbec56faeba4a5 (patch) | |
tree | cef245074b4ee0421c3166524860a8324d779747 /bundles/org.eclipse.team.ui | |
parent | c2c49ae019e9b53f5878ef02e6d6227f6c169240 (diff) | |
download | eclipse.platform.team-11a5ccdf45223eae40f83dbbb9cbec56faeba4a5.tar.gz eclipse.platform.team-11a5ccdf45223eae40f83dbbb9cbec56faeba4a5.tar.xz eclipse.platform.team-11a5ccdf45223eae40f83dbbb9cbec56faeba4a5.zip |
Bug 101252 [Actions] Key binding for Apply patch is missing
Diffstat (limited to 'bundles/org.eclipse.team.ui')
3 files changed, 55 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties index 5edff3e26..5c041d3ba 100644 --- a/bundles/org.eclipse.team.ui/plugin.properties +++ b/bundles/org.eclipse.team.ui/plugin.properties @@ -26,6 +26,11 @@ IgnorePreferencePage.name=Ignored Resources ConfigureProject.label=&Share Project... ConfigureProject.tooltip=Share the project with others using a version and configuration management system. +ApplyPatch.label=Appl&y Patch... +ApplyPatch.tootip=Apply a patch to one or more workspace projects. +Command.applyPatch.name=Apply Patch... +Command.applyPatch.description=Apply a patch to one or more workspace projects. + ImportProjectSet.label=Import Project &Set... TeamGroupMenu.label=T&eam diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml index 52dd07626..866daccd7 100644 --- a/bundles/org.eclipse.team.ui/plugin.xml +++ b/bundles/org.eclipse.team.ui/plugin.xml @@ -284,6 +284,12 @@ id="org.eclipse.team.ui.synchronizeLast"> </command> <command + name="%Command.applyPatch.name" + categoryId="org.eclipse.team.ui.category.team" + description="%Command.applyPatch.description" + id="org.eclipse.team.ui.applyPatch"> + </command> + <command name="%Synchronizing.perspective" description="%Synchronizing.openPerspectiveDescription" categoryId="org.eclipse.ui.category.perspectives" @@ -338,6 +344,14 @@ class="org.eclipse.team.internal.ui.actions.ConfigureProjectAction" menubarPath="project/open.ext" id="org.eclipse.team.ui.ConfigureProject"/> + <action + allowLabelUpdate="true" + class="org.eclipse.team.internal.ui.actions.ApplyPatchAction" + definitionId="org.eclipse.team.ui.applyPatch" + id="org.eclipse.team.ui.ApplyPatchAction" + label="%ApplyPatch.label" + menubarPath="project/additions" + tooltip="%ApplyPatch.tooltip"/> </actionSet> </extension> diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java new file mode 100644 index 000000000..7d55e0519 --- /dev/null +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/ApplyPatchAction.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2006 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.team.internal.ui.actions; + +import org.eclipse.compare.patch.ApplyPatchOperation; +import org.eclipse.core.resources.IResource; +import org.eclipse.jface.action.IAction; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.widgets.Display; +import org.eclipse.team.core.TeamException; + +public class ApplyPatchAction extends TeamAction { + + protected boolean isEnabled() throws TeamException { + return true; + } + + public void run(IAction action) { + IResource[] resources = getSelectedResources(); + IResource resource = null; + if (resources.length > 0) { + resource = resources[0]; + } + ApplyPatchOperation op = new ApplyPatchOperation(getTargetPart(), resource); + BusyIndicator.showWhile(Display.getDefault(), op); + } + +} |