Hi Thanks a lot for your time !
Yes, you have understood my problem correctly. I though about extending the
Adapter as well, but then got carried away with other things.
Nevertheless, I came to the same conclusion as you have below, that
the pivot model is something I have to convert my Cayenne lists to.
For two reasons, the one you state below, that they are more
"Pivot:ish" and work better inside Pivot and the other that I actually send
in my Cayenne data model into the Pivot framework through the ListAdapter
having no idea of what the framework actually might do with it ;-)
So, I have now converted "my data model" to "pivot model" where needed
and are no longer using the ListAdapter. Everything works great, so I have
now released my first milestone of a Pivot-based Cross Country Skiing
competition management and time recording application at
http://blog.stenlund.cc.
Once again, thanks a lot for your effort,
Tomas
On 07/16/2012 05:26 PM, Sandro Martini wrote:
Hi Tomas,
I hope to understand in the right way your problem ...
Did you tried to make a custom version od ListAdapter, like:
public class ListAdapterWithDefaultList<T> extends ListAdapter<T>
implements List<T>, Serializable {
private static final long serialVersionUID = -7329284780271109312L;
public ListAdapterWithDefaultList() {
super(new java.util.ArrayList<T>());
}
// TODO: here ...
}
and in the TODO maybe override the methods that gives to you problems,
like remove (just a a idea to start, if appliable to your case) ?
Pivot collections were made to be used extensively inside Pivot, but
of course the counterpart is that conversions are needed between Java
standard collections and Pivot version, I know ... so think of them as
a "Pivot model" near to Components.
Many frameworks need conversions between "models" so this shouldn't be
a great problem (generally speaking).
With Scala I made some prototypes (using Scala implicits) for
transparent conversions between Scala and Pivot Collections, just as
idea.
I hope to give you some useful info, but if you have some minimal code
to post we can try to see if/what to improve in Pivot to simplify it
(maybe even with some API change, but for 2.1.x).
Tell me.
Bye,
Sandro