return formatted.toString();
}
private MessageAndAnswers formatNumberedAnsiMessage(String message, List<String> possibleValues, String defaultValue)
{
ANSIBuffer formatted = new ANSIBuffer();
formatted.bold(message).append("\n");
List<String> answers = new ArrayList<String>();
String defaultAnswer = "1";
int counter = 1;
for (String val : possibleValues)
{
String answer = String.valueOf(counter);
if(val.equals(defaultValue))
{
formatted.bold(answer);
defaultAnswer = answer;
}
else
{
formatted.append(answer);
}
if (counter < 10)
{
formatted.append(": ");
} else
{
formatted.append(": ");
}
if(val.equals(defaultValue))
{
formatted.bold(val).append("\n");
}
else
{
formatted.append(val).append("\n");
}
answers.add(answer);
counter++;
}
formatted.bold("Choose a number");
return new MessageAndAnswers(formatted.toString(),answers,defaultAnswer);
}