public void execute(RefactoringInfo refactoringInfo, int locationStrategy) {
try {
String creationStr = this.getCreationStr();
final String asTitle = StringUtils.getWithFirstUpper(creationStr);
PySelection pySelection = refactoringInfo.getPySelection();
Tuple<String, Integer> currToken = pySelection.getCurrToken();
String actTok = currToken.o1;
List<String> parametersAfterCall = null;
if (actTok.length() == 0) {
InputDialog dialog = new InputDialog(PyAction.getShell(), asTitle + " name",
"Please enter the name of the " + asTitle + " to be created.", "", new IInputValidator() {
public String isValid(String newText) {
if (newText.length() == 0) {
return "The " + asTitle + " name may not be empty";
}
if (StringUtils.containsWhitespace(newText)) {
return "The " + asTitle + " name may not contain whitespaces.";
}
return null;
}
});
if (dialog.open() != InputDialog.OK) {
return;
}
actTok = dialog.getValue();
} else {
parametersAfterCall = pySelection.getParametersAfterCall(currToken.o2 + actTok.length());
}
execute(refactoringInfo, actTok, parametersAfterCall, locationStrategy);
} catch (BadLocationException e) {