1 11 package org.eclipse.jdt.internal.corext.refactoring.changes; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IPath; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 17 import org.eclipse.core.resources.IContainer; 18 import org.eclipse.core.resources.IResource; 19 20 import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; 21 import org.eclipse.jdt.internal.corext.refactoring.reorg.INewNameQuery; 22 import org.eclipse.jdt.internal.corext.util.Messages; 23 24 import org.eclipse.ltk.core.refactoring.Change; 25 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 26 27 public class CopyResourceChange extends ResourceReorgChange { 28 29 public CopyResourceChange(IResource res, IContainer dest, INewNameQuery newNameQuery){ 30 super(res, dest, newNameQuery); 31 } 32 33 public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { 34 return super.isValid(pm, NONE); 39 } 40 41 protected Change doPerformReorg(IPath path, IProgressMonitor pm) throws CoreException{ 42 getResource().copy(path, getReorgFlags(), pm); 43 return null; 44 } 45 46 public String getName() { 47 return Messages.format(RefactoringCoreMessages.CopyResourceString_copy, 48 new String []{getResource().getFullPath().toString(), getDestination().getName()}); 49 } 50 } 51 | Popular Tags |