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.util.Messages; 22 23 import org.eclipse.ltk.core.refactoring.Change; 24 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 25 26 public class MoveResourceChange extends ResourceReorgChange { 27 28 public MoveResourceChange(IResource res, IContainer dest){ 29 super(res, dest, null); 30 } 31 32 public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { 33 return super.isValid(pm, DIRTY); 39 } 40 41 44 protected Change doPerformReorg(IPath path, IProgressMonitor pm) throws CoreException{ 45 getResource().move(path, getReorgFlags(), pm); 46 return null; 47 } 48 public String getName() { 49 return Messages.format(RefactoringCoreMessages.MoveResourceChange_move, 50 new String []{getResource().getFullPath().toString(), getDestination().getName()}); 51 } 52 } 53 54 | Popular Tags |