1 11 package org.eclipse.jdt.internal.debug.core.refactoring; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 import org.eclipse.jdt.core.IField; 17 import org.eclipse.jdt.core.JavaModelException; 18 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.RenameParticipant; 23 24 26 public class JavaWatchpointIFieldRenameParticipant extends RenameParticipant { 27 28 private IField fField; 29 30 protected boolean initialize(Object element) { 31 fField= (IField) element; 32 try { 33 return !fField.getDeclaringType().isLocal(); 34 } catch (JavaModelException e) { 35 return false; 36 } 37 } 38 39 public String getName() { 40 return RefactoringMessages.JavaWatchpointIFieldRenameParticipant_0; } 42 43 public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) { 44 return new RefactoringStatus(); 45 } 46 47 50 public Change createChange(IProgressMonitor pm) throws CoreException { 51 return JavaWatchpointFieldNameChange.createChange(fField, getArguments().getNewName()); 52 } 53 } 54 | Popular Tags |