True, though I've seen applications, even AJAX-enabled web apps, that allow the user to move a row an arbitrary number of places at once, for which a method like this would be necessary. As for the wrapping around the top and bottom, it's not how everyone does it, of course, but I find it useful to implement it that way because it means that if you have an element at the bottom of a ten-row list, say, and want to move it to the top, it takes you only one click (and server-hit) instead of nine.
-Matt On 2/1/06, James Carman <[EMAIL PROTECTED]> wrote: > > Typically you move them one row at a time, though. Correct? For that you > can use java.util.Collections.swap(). The "move up" button just swaps the > currently selected row with the one above it. And, it would be disabled > if > it's the first item in the list. I don't think I've ever implemented it > so > that it rolls around to the bottom of the list as you mentioned. > > -----Original Message----- > From: Matt Blum [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 01, 2006 8:36 AM > To: Jakarta Commons Developers List > Subject: Re: [collections] New utility methods for CollectionUtils & > ListUtils > > Since the dependency in my deep-clone method is only on > SerializationUtils, > and the clone method there just serializes and then deserializes the > object > being cloned, it might be easiest to avoid the dependency by simply > re-implementing that functionality in my method. What do you think? > > As for the move method I mentioned, I don't think it's as specialized as > several have said. I implemented it for a web application that stored the > rows in a data list in a List, and I had to make it possible for the user > to > move a row up or down in the list. I think this is, while not an eveyday > requirement, certainly common enough that inclusion of the method has some > merit. > > -Matt > > On 2/1/06, Torsten Curdt <[EMAIL PROTECTED]> wrote: > > > > > > On 02.02.2006, at 00:06, Jörg Schaible wrote: > > > > > Torsten Curdt wrote on Wednesday, February 01, 2006 12:25 PM: > > > > > >>> This could be useful, but would need to be done without a > > >>> dependency on commons-lang. > > >> > > >> We already talked about that at the ApacheCon. > > >> > > >> Maybe it would useful to loosen such requirements by using tools like > > >> "minijar" > > >> > > >> http://vafer.org/blog/tag/minijar > > >> > > >> or "proguard + jarjar" > > >> > > >> http://proguard.sourceforge.net/ > > >> http://tonicsystems.com/products/jarjar/ > > >> > > >> we add the dependency so we don't duplicate code but strip the > > >> unnecessary classes and inline the remaining. > > >> > > >> WDYT? > > > > > > Looking at proguard, this might be enough. Why do you think, jarjar > > > is also necessary ? > > > > Jarjar is better suited for the inlining. Unfortunately proguards > > configuration sucks quite bad and it require all transitive deps > > to be analyzed. Both are GPL btw. > > > > That's why I came up with minijar ...mainly for using it for jci. > > > > cheers > > -- > > Torsten > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
