Skip to content

Commit

Permalink
FORGE-2041: Fixed UIInputMany prompt display
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Nov 11, 2014
1 parent e1bc461 commit c1196d1
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -116,7 +116,7 @@ public Object promptValueFrom(InputComponent<?, ?> input) throws InterruptedExce
else
{
// UIInput
value = promptInputComponent(input);
value = promptInputComponent(input, input.getValue());
}
}
else if (input instanceof ManyValued)
Expand All @@ -139,7 +139,7 @@ else if (input instanceof ManyValued)
else
{
// UIInputMany
promptValue = promptInputComponent(input);
promptValue = promptInputComponent(input, inputValues);
}
if (promptValue != null)
{
Expand Down Expand Up @@ -204,18 +204,22 @@ private boolean promptBooleanInternal(String message, boolean defaultValue) thro
}
}

private Object promptInputComponent(InputComponent<?, ?> input) throws InterruptedException
private Object promptInputComponent(InputComponent<?, ?> input, Object componentValue) throws InterruptedException
{
Object value;
String label = InputComponents.getLabelFor(input, false);
String description = input.getDescription();
Object componentValue = InputComponents.getValueFor(input);
if (!Strings.isNullOrEmpty(description))
{
description = " (" + description + ")";
}
String defaultValueDescription;
if (componentValue != null)
System.out.println();
if (componentValue instanceof Collection)
{
defaultValueDescription = " " + componentValue.toString();
}
else if (componentValue != null)
{
defaultValueDescription = " [" + componentValue + "]";
}
Expand Down

0 comments on commit c1196d1

Please sign in to comment.