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.util.Messages; 24 25 public class MovePackageChange extends PackageReorgChange { 26 27 public MovePackageChange(IPackageFragment pack, IPackageFragmentRoot dest){ 28 super(pack, dest, null); 29 } 30 31 protected Change doPerformReorg(IProgressMonitor pm) throws JavaModelException, OperationCanceledException { 32 getPackage().move(getDestination(), null, getNewName(), true, pm); 33 return null; 34 } 35 36 public String getName() { 37 return Messages.format(RefactoringCoreMessages.MovePackageChange_move, 38 new String []{getPackage().getElementName(), getDestination().getElementName()}); 39 } 40 } 41 | Popular Tags |