Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2615

Forge addon - From one command be able to easily split into a wizard with N pages



    • Feature Request
    • Resolution: Unresolved
    • Major
    • 3.x Future
    • 3.0.0.CR1
    • UI - API
    • None



      When you build commands in forge that you want to be like a wizard, with 3 pages, where you on page 1 have 3 inputs, on page 2 4 inputs, and on page 3 2 inputs. Then today you need to build that in multiple classes with UIStep and initialize the ui for each step, and put them all together and whatnot.

      This seems sometimes a bit too much for those simpler commands, where basically you wish you could write all that in just one java class. And then tell forge to split the UI elements into 3 pages, and tell it which UI elements go into what page. Then forge makes that automatic a wizard with next/back/finish buttons.

      Then from the logic point of view. It works 100% as if would do if there was just 1 page with all the inputs on the same page. So validation / listeners and so on all react.

      The idea is just to allow the end user to much easier break this up into steps that makes the command better to use for end users. You may on the first page to have ui fields that take in some mandatory fields, and then on page 2 some fields that are related together in some way, and then on page 3 yet another group of related options.

      You should also be able to configure the title of each page in that steps. So maybe you can in the initiizeUI method do:


      Notice how we use next to tell forge that we want the following inputs on the next page.

      Or maybe you can specify the title also as:

      builder.add(one).add(to).nextWithTitle("Configure foo stuff").add(three).add(four).nextWithTitle("Configure bar stuff").add(five);




            Unassigned Unassigned
            cibsen@redhat.com Claus Ibsen
            0 Vote for this issue
            2 Start watching this issue