1 11 package org.eclipse.jdt.internal.corext.refactoring.changes; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 import org.eclipse.core.resources.IProject; 17 18 import org.eclipse.ltk.core.refactoring.Change; 19 20 import org.eclipse.jdt.core.IPackageFragmentRoot; 21 import org.eclipse.jdt.core.JavaModelException; 22 23 import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; 24 import org.eclipse.jdt.internal.corext.refactoring.reorg.INewNameQuery; 25 import org.eclipse.jdt.internal.corext.refactoring.reorg.IPackageFragmentRootManipulationQuery; 26 import org.eclipse.jdt.internal.corext.util.Messages; 27 28 public class CopyPackageFragmentRootChange extends PackageFragmentRootReorgChange { 29 30 public CopyPackageFragmentRootChange(IPackageFragmentRoot root, IProject destination, INewNameQuery newNameQuery, IPackageFragmentRootManipulationQuery updateClasspathQuery) { 31 super(root, destination, newNameQuery, updateClasspathQuery); 32 } 33 34 protected Change doPerformReorg(IPath destinationPath, IProgressMonitor pm) throws JavaModelException { 35 getRoot().copy(destinationPath, getResourceUpdateFlags(), getUpdateModelFlags(true), null, pm); 36 return null; 37 } 38 39 public String getName() { 40 String [] keys= {getRoot().getElementName(), getDestinationProject().getName()}; 41 return Messages.format(RefactoringCoreMessages.CopyPackageFragmentRootChange_copy, keys); 42 } 43 } 44 | Popular Tags |