use of org.erlide.wrangler.refactoring.selection.IErlSelection.SelectionKind in project erlide_eclipse by erlang.
the class TupleFunctionParametersRefactoring method checkInitialConditions.
@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) {
final IErlMemberSelection s = (IErlMemberSelection) sel;
numberOfTuplingParameters = calculateParametersNumber(WranglerUtils.getTextFromEditor(s.getSelectionRange(), s.getDocument()));
if (numberOfTuplingParameters > 0) {
return new RefactoringStatus();
}
}
}
return RefactoringStatus.createFatalErrorStatus("Please select function parameters!");
}
Aggregations