1 11 12 package org.eclipse.jdt.internal.debug.core.refactoring; 13 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.core.runtime.OperationCanceledException; 17 import org.eclipse.jdt.core.IPackageFragment; 18 import org.eclipse.jdt.core.IPackageFragmentRoot; 19 import org.eclipse.ltk.core.refactoring.Change; 20 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 21 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; 22 import org.eclipse.ltk.core.refactoring.participants.MoveParticipant; 23 24 25 28 public class LaunchConfigurationIPackageFragmentMoveParticipant extends MoveParticipant { 29 30 private IPackageFragment fPackageFragment; 31 private IPackageFragmentRoot fDestination; 32 33 36 protected boolean initialize(Object element) { 37 fPackageFragment= (IPackageFragment)element; 38 Object destination= getArguments().getDestination(); 39 if (destination instanceof IPackageFragmentRoot) { 40 fDestination= (IPackageFragmentRoot) destination; 41 if (fDestination.getJavaProject().equals(fPackageFragment.getJavaProject())) { 43 return false; 44 } 45 return true; 46 } 47 return false; 48 } 49 50 53 public String getName() { 54 return RefactoringMessages.LaunchConfigurationParticipant_0; 55 } 56 57 60 public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException { 61 return new RefactoringStatus(); 62 } 63 64 67 public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { 68 return JDTDebugRefactoringUtil.createChangesForPackageMove(fPackageFragment, fDestination); 69 } 70 71 } 72 | Popular Tags |