1 4 package org.terracotta.dso.refactoring; 5 6 import org.eclipse.core.runtime.IProgressMonitor; 7 import org.eclipse.core.runtime.OperationCanceledException; 8 import org.eclipse.jdt.core.IType; 9 import org.eclipse.ltk.core.refactoring.Change; 10 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 11 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; 12 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant; 13 14 public class RenameTypeParticipant extends RenameParticipant { 15 private IType fType; 16 private String fDestination; 17 18 public RefactoringStatus checkConditions(IProgressMonitor pm, 19 CheckConditionsContext context) 20 throws OperationCanceledException 21 { 22 return new RefactoringStatus(); 23 } 24 25 public Change createChange(IProgressMonitor pm) 26 throws OperationCanceledException 27 { 28 return createChangesForTypeRename(fType, fDestination); 29 } 30 31 public String getName() { 32 return "TCRenameTypeChange"; 33 } 34 35 protected boolean initialize(Object element) { 36 fType = (IType)element; 37 fDestination = getArguments().getNewName(); 38 39 return true; 40 } 41 42 public static Change createChangesForTypeRename(IType type, String destination) { 43 return new RenameTypeChange(type, destination); 44 } 45 } 46 | Popular Tags |