blob: 577c0c6893a84b9f0d72904df4f4f4e96226f29d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2003 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.IType;
import org.eclipse.jdt.internal.corext.refactoring.base.IChange;
import org.eclipse.jdt.internal.corext.refactoring.base.RefactoringStatus;
import org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringProcessor;
import org.eclipse.jdt.internal.corext.refactoring.participants.RenameParticipant;
/**
*/
public class LaunchConfigurationITypeRenameParticipant extends RenameParticipant {
private IType fType;
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#initialize(org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringProcessor, java.lang.Object)
*/
public void initialize(IRefactoringProcessor processor, Object element) {
super.initialize(processor);
fType= (IType) element;
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#isAvailable()
*/
public boolean isAvailable() {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#operatesOn(java.lang.Object)
*/
public boolean operatesOn(Object element) {
return fType.equals(element);
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#checkActivation()
*/
public RefactoringStatus checkActivation() {
return new RefactoringStatus();
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#checkInput(org.eclipse.core.runtime.IProgressMonitor)
*/
public RefactoringStatus checkInput(IProgressMonitor pm) {
return new RefactoringStatus();
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
public IChange createChange(IProgressMonitor pm) throws CoreException {
return LaunchConfigurationMainTypeNameChange.createChangesFor(fType, getNewName());
}
}