-
1. Re: [forge-dev] Adding methods to the CommandController
danielcunha Feb 19, 2015 4:32 AM (in response to Antonio Goncalves )+1
On Thu, Feb 19, 2015 at 6:23 AM, Antonio Goncalves
<antonio.mailing@gmail.com> wrote:
Hi all,
I'm investigating how to refactor UICommands in the best way (see the
analysis in https://issues.jboss.org/browse/FORGE-2109). But before
refactoring, I would like to add a stronger test coverage so I make sure I
don't break things.
>
I was looking at CommandController that list of the command inputs :
Map<String, InputComponent<?, ?>> getInputs();
>
I would like to add the following commands
InputComponent<?, ?> getInput(String input); // returns one input
boolean hasInput(String input); // checks if the input is present
>
What do you think ?
--
Antonio Goncalves
Software architect and Java Champion
Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
_______________________________________________
forge-dev mailing list
--
Daniel Cunha (soro)
_______________________________________________
forge-dev mailing list
https://lists.jboss.org/mailman/listinfo/forge-dev
-
2. Re: [forge-dev] Adding methods to the CommandController
gastaldi Feb 19, 2015 5:13 AM (in response to Antonio Goncalves )Hi Antonio,
How different is that from the immutable Map? I find the Map more flexible in terms of:
- you can do inputs.keySet() and iterate through the input names (there are some places where we do this)
- some UIProviders need to know if a Command has any input at all to decide if it should execute or should render the Wizard screen.
So I am not sure if this is a good idea, but I may be wrong
Best Regards,
George Gastaldi
Em 19/02/2015, às 07:24, Antonio Goncalves <antonio.mailing@gmail.com> escreveu:
Hi all,
I'm investigating how to refactor UICommands in the best way (see the analysis in https://issues.jboss.org/browse/FORGE-2109). But before refactoring, I would like to add a stronger test coverage so I make sure I don't break things.
I was looking at CommandController that list of the command inputs :
Map<String, InputComponent<?, ?>> getInputs();
I would like to add the following commands
InputComponent<?, ?> getInput(String input); // returns one input
boolean hasInput(String input); // checks if the input is present
What do you think ?
--
Antonio Goncalves
Software architect and Java Champion
Web site | Twitter | LinkedIn | Paris JUG | Devoxx France
_______________________________________________
forge-dev mailing list
-
att1.html.zip 1.3 KB
-
-
3. Re: [forge-dev] Adding methods to the CommandController
Well, you are the boss, I'm just an API user... but would like my life to
be simplified ;o) Of course I can iterate through a map in each of the
tests, but if there was already a method, that would help. Because, in
Roaster, we find this pattern all over the place : getMethods(),
getMethod(String s), hasMethod(Method m), getAnnotations(),
getAnnotation(String s), hasAnnotation(Annotation a).... I find this handy,
and manipulating the CommandController often... well, it helps ;o)
Antonio
2015-02-19 11:13 GMT+01:00 George Gastaldi <ggastald@redhat.com>:
Hi Antonio,
How different is that from the immutable Map? I find the Map more flexible
in terms of:
- you can do inputs.keySet() and iterate through the input names (there
are some places where we do this)
- some UIProviders need to know if a Command has any input at all to
decide if it should execute or should render the Wizard screen.
So I am not sure if this is a good idea, but I may be wrong
Best Regards,
George Gastaldi
>
Em 19/02/2015, às 07:24, Antonio Goncalves <antonio.mailing@gmail.com>
escreveu:
Hi all,
I'm investigating how to refactor UICommands in the best way (see the
analysis in https://issues.jboss.org/browse/FORGE-2109). But before
refactoring, I would like to add a stronger test coverage so I make sure I
don't break things.
>
I was looking at CommandController that list of the command inputs :
Map<String, InputComponent<?, ?>> getInputs();
>
I would like to add the following commands
InputComponent<?, ?> getInput(String input); // returns one input
boolean hasInput(String input); // checks if the input is present
>
What do you think ?
--
Antonio Goncalves
Software architect and Java Champion
Web site <http://www.antoniogoncalves.org/> | Twitter
<http://twitter.com/agoncal> | LinkedIn
<http://www.linkedin.com/in/agoncal> | Paris JUG
<http://www.parisjug.org/> | Devoxx France <http://www.devoxx.fr/>
_______________________________________________
forge-dev mailing list
https://lists.jboss.org/mailman/listinfo/forge-dev
>
_______________________________________________
forge-dev mailing list
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Antonio Goncalves
Software architect and Java Champion
Web site <http://www.antoniogoncalves.org/> | Twitter
<http://twitter.com/agoncal> | LinkedIn <http://www.linkedin.com/in/agoncal>
| Paris JUG <http://www.parisjug.org/> | Devoxx France