1 11 package org.eclipse.jdt.internal.corext.refactoring.changes; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.OperationCanceledException; 15 16 import org.eclipse.ltk.core.refactoring.Change; 17 18 import org.eclipse.jdt.core.IPackageFragment; 19 import org.eclipse.jdt.core.IPackageFragmentRoot; 20 import org.eclipse.jdt.core.JavaModelException; 21 22 import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; 23 import org.eclipse.jdt.internal.corext.refactoring.reorg.INewNameQuery; 24 import org.eclipse.jdt.internal.corext.util.Messages; 25 26 public class CopyPackageChange extends PackageReorgChange { 27 28 public CopyPackageChange(IPackageFragment pack, IPackageFragmentRoot dest, INewNameQuery nameQuery){ 29 super(pack, dest, nameQuery); 30 } 31 32 protected Change doPerformReorg(IProgressMonitor pm) throws JavaModelException, OperationCanceledException { 33 getPackage().copy(getDestination(), null, getNewName(), true, pm); 34 return null; 35 } 36 37 public String getName() { 38 return Messages.format(RefactoringCoreMessages.CopyPackageChange_copy, 39 new String []{ getPackage().getElementName(), getDestination().getElementName()}); 40 } 41 } 42 | Popular Tags |