[forge-issues] [JBoss JIRA] (FORGE-1407) Shell is missing options in wizards where default values allow immediately moving to next step
Lincoln Baxter III (JIRA)
issues at jboss.org
Sat Jan 4 14:18:32 EST 2014
[ https://issues.jboss.org/browse/FORGE-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lincoln Baxter III reopened FORGE-1407:
---------------------------------------
Not quite working for the `scaffold-setup` wizard:
{code}
[jpa-demo]$ scaffold-
scaffold-generate scaffold-setup
[jpa-demo]$ scaffold-setup --facesVersion 2.
2.2 2.1 2.0
[jpa-demo]$ scaffold-setup --facesVersion 2.
2.2 2.1 2.0
[jpa-demo]$ scaffold-setup --facesVersion 2.2
{code}
As you can see, the options that should be available are not, and the wizard moves immediately to the next setup step:
{code}
@Inject
@WithAttributes(label = "Provider", required = true)
private UISelectOne<ScaffoldProvider> provider;
@Inject
@WithAttributes(label = "Target Directory")
private UIInput<String> target;
@Inject
@WithAttributes(label = "Overwrite existing files?", defaultValue = "false")
private UIInput<Boolean> overwrite;
{code}
> Shell is missing options in wizards where default values allow immediately moving to next step
> ----------------------------------------------------------------------------------------------
>
> Key: FORGE-1407
> URL: https://issues.jboss.org/browse/FORGE-1407
> Project: Forge
> Issue Type: Feature Request
> Components: UI - Shell
> Affects Versions: 2.0.0.Beta4
> Reporter: Lincoln Baxter III
> Assignee: Lincoln Baxter III
> Fix For: 2.0.0.Final
>
>
> Should have a lot more options:
> {code}
> [jpa-demo]$ jpa-setup
> --dataSourceName --dbType --persistenceUnitName
> {code}
> The problem is here in ShellWizard.java (in shell addon)
> {code}
> private CommandLineParser populate(ShellContext shellContext, String line,
> final Map<String, InputComponent<?, ?>> inputs)
> throws Exception
> {
> inputs.putAll(getController().getInputs());
> CommandLineParser parser = commandLineUtil.generateParser(getController(), shellContext, inputs);
> CommandLine cmdLine = parser.parse(line, true);
> Map<String, InputComponent<?, ?>> populatedInputs = commandLineUtil.populateUIInputs(cmdLine, inputs);
> if (getController().isValid())
> {
> if (getController().canMoveToNextStep())
> {
> // The bug is here. we are immediately moving to the next step and removing all inputs that are not populated.
> // this really needs to know if we have defaulted to next step or actually moved there willingly
> // it should not remove old choices until a new choice has been made
> getController().next().initialize();
> inputs.keySet().retainAll(populatedInputs.keySet());
> parser = populate(shellContext, line, inputs);
> }
> }
> return parser;
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list