public class FunctionToProcessRefactoring extends ProcessRelatedRefactoring {
@Override
public RefactoringStatus checkInitialConditions(final IProgressMonitor pm)
throws CoreException, OperationCanceledException {
final IErlSelection sel = GlobalParameters.getWranglerSelection();
if (sel instanceof IErlMemberSelection) {
final SelectionKind kind = sel.getKind();
if (kind == SelectionKind.FUNCTION_CLAUSE || kind == SelectionKind.FUNCTION) {
return new RefactoringStatus();
}
}
return RefactoringStatus.createFatalErrorStatus("Please select a function!");