Put a feature request in JIRA if you can explain exactly how you would like it to work.
But I guess I'm not sure that it makes sense, Java has a natural built-in datastructure for defining lists (List), but nothing for trees. I guess it makes more sense to simply use a TreeModel directly....
I will try to get a bit more experience in using it directly. And I will post a feature request if I have something against using @In @Out TreeModel.
I've been thinking that Seam should be able to support arbitrary transformations on inject/outject. @DataModel is brilliant because it let's your pojo values get morphed into UI classes, keeping your code clean. I think there are lots of other cases where this would make sense. (@TreeModel, possibly being one of them)
Adding @TreeModel into Seam would be a bit of a pain because you'd have to add code to several different classes, pretty much everywhere the @DataModel stuff is.
I'd like to be able to write an @TreeModel outside of seam in the same way I can write @LoggedIn or @LoginIf by plugging into the interceptor stack. It would be very cool to be able to plug into the injector stack.
What you really want to be able to do with TreeModels is take a tree of POJO objects and "map" them to a TreeModel. EG:
@TreeModel(children="subcategories") Category rootCategory;
@TreeModelSelection Category selectedCategory;
This is fine for "uniform" trees where all nodes at all levels of the tree are instances of the same class. But what about heterogeneous trees where nodes are of various different classes?
You could add an @TreeModelChildren annotation, but that is pretty intrusive into the domain model. Not good seperation of concerns.