/**
* <p>Copyright: Copyright (c) 2009</p>
* <p>Company: �������ӹɷ�����˾</p>
*/
package com.hundsun.ares.studio.ui.refactoring;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
import com.hundsun.ares.studio.core.IARESElement;
/**
*
* @author sundl
*/
public abstract class AresElementMoveParticipant extends MoveParticipant {
protected IARESElement element;
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
@Override
protected boolean initialize(Object element) {
if (element instanceof IARESElement) {
this.element = (IARESElement) element;
return true;
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
@Override
public String getName() {
return element.getElementName();
}
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
RefactoringStatus result = new RefactoringStatus();
if (element == null)
result.addError("element is null");
return result;
}
}