protected WranglerRefactoring runGenFunRefactoring(
final ArrayList<WranglerPage> pages, final Shell activeShell)
throws OtpErlangRangeException {
WranglerRefactoring refactoring = null;
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters
.getWranglerSelection();
// Ask the user about a new name
final NewParameterNameInputDialog dialog = new NewParameterNameInputDialog(
activeShell, "New parameter name");
dialog.open();
if (!dialog.isFinished()) {
return null;
}
final String newParamName = dialog.getData();
dialog.close();
// call initial RPC
final GenFunRefactoringMessage m = (GenFunRefactoringMessage) WranglerBackendManager
.getRefactoringBackend().callWithParser(new GenFunRefactoringMessage(),
"generalise_eclipse", "sxxsxi", sel.getFilePath(),
sel.getSelectionRange().getStartPos(),
sel.getSelectionRange().getEndPos(), newParamName,
sel.getSearchPath(), GlobalParameters.getTabWidth());
// Examine the result of the refactoring: 4 cases
if (m.getRefactoringState() == RefactoringState.OK) {
refactoring = new GeneraliseFunctionRefactoring(State.ok, m);