]
Lincoln Baxter III commented on FORGE-2233:
-------------------------------------------
To publish this doc:
{code}
1) convert the doc to asciidoc
2) host that doc on github at
Documenting how to create and test a command that updates Java code
-------------------------------------------------------------------
Key: FORGE-2233
URL:
https://issues.jboss.org/browse/FORGE-2233
Project: Forge
Issue Type: Sub-task
Components: Documentation
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
Assignee: George Gastaldi
Fix For: 2.x Future
The idea is to document commands that add new code to existing classes ({{add}}
commands). Example, the command to add a [CDI producer|FORGE-2079] or add a [CDI injection
point|FORGE-2226]
Draft notes from #IRC
gastaldi UIContext.getInitialSelection() should return a UISelection of Resource objects
gastaldi Call get() on it and you should have a JavaResource if the command is executed
in the context of a java class
gastaldi Make it the default value of the targetClass field
agoncal What does the Callable do in the initializeUI method do then ?
gastaldi That should be used when the value changes over the UI interaction
gastaldi That is not the case afaik
gastaldi Because once you execute the command, the initial selection will not change