1 11 package org.eclipse.team.internal.ui.actions; 12 13 import java.lang.reflect.InvocationTargetException ; 14 15 import org.eclipse.compare.patch.ApplyPatchOperation; 16 import org.eclipse.core.resources.IResource; 17 import org.eclipse.jface.action.IAction; 18 import org.eclipse.swt.custom.BusyIndicator; 19 import org.eclipse.swt.widgets.Display; 20 21 public class ApplyPatchAction extends TeamAction { 22 23 public boolean isEnabled() { 24 return true; 25 } 26 27 protected void execute(IAction action) throws InvocationTargetException , 28 InterruptedException { 29 IResource[] resources = getSelectedResources(); 30 IResource resource = null; 31 if (resources.length > 0) { 32 resource = resources[0]; 33 } 34 ApplyPatchOperation op = new ApplyPatchOperation(getTargetPart(), resource); 35 BusyIndicator.showWhile(Display.getDefault(), op); 36 } 37 38 } 39 | Popular Tags |