blob: 7706cb091f13057264a49d2cfc8dc7e904639910 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.debug.core.refactoring;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
/**
*/
public class JavaWatchpointIFieldRenameParticipant extends RenameParticipant {
private IField fField;
protected boolean initialize(Object element) {
fField= (IField) element;
try {
return !fField.getDeclaringType().isLocal();
} catch (JavaModelException e) {
return false;
}
}
public String getName() {
return RefactoringMessages.getString("JavaWatchpointIFieldRenameParticipant.0"); //$NON-NLS-1$
}
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
return new RefactoringStatus();
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
public Change createChange(IProgressMonitor pm) throws CoreException {
return JavaWatchpointFieldNameChange.createChange(fField, getArguments().getNewName());
}
}