Getting the deleted element

View: New views
4 Messages — Rating Filter:   Alert me  

Getting the deleted element

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would like to get the deleted element inside my listener. But it seems thet ListEvent.getIndex() does not return the deleted element, as it has already been removed from the list when the listener is called.
Is there a way to get the item before its deletion?

Thanks,
Phil

Re: Getting the deleted element

by James Lemieux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Phil, unfortunately at the moment, the only way to access a deleted element is to maintain a private ArrayList inside of your ListEventListener. It essentially acts as a cache of the source list.

Inelegant, but it'll keep you moving forward....

James

On Wed, Jul 2, 2008 at 5:28 AM, philk <phil.kursawe@...> wrote:

I would like to get the deleted element inside my listener. But it seems thet
ListEvent.getIndex() does not return the deleted element, as it has already
been removed from the list when the listener is called.
Is there a way to get the item before its deletion?

Thanks,
Phil
--
View this message in context: http://www.nabble.com/Getting-the-deleted-element-tp18236362p18236362.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Getting the deleted element

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ouch that is a pity. I guess thats due to performance optimizations?
Thanks for your quick response James, as always :)

James Lemieux wrote:
Phil, unfortunately at the moment, the only way to access a deleted element
is to maintain a private ArrayList inside of your ListEventListener. It
essentially acts as a cache of the source list.

Inelegant, but it'll keep you moving forward....

James

On Wed, Jul 2, 2008 at 5:28 AM, philk <phil.kursawe@gmail.com> wrote:

>
> I would like to get the deleted element inside my listener. But it seems
> thet
> ListEvent.getIndex() does not return the deleted element, as it has already
> been removed from the list when the listener is called.
> Is there a way to get the item before its deletion?
>
> Thanks,
> Phil
> --
> View this message in context:
> http://www.nabble.com/Getting-the-deleted-element-tp18236362p18236362.html
> Sent from the GlazedLists - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glazedlists.dev.java.net
> For additional commands, e-mail: users-help@glazedlists.dev.java.net
>
>

Re: Getting the deleted element

by James Lemieux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Phil, I'm afraid not. It's due to short-sightedness in the early days of GL. GL 2.0 is/was supposed to introduce deleted elements right into the ListEvent, but retrofitting this ability into all of our existing EventList implementations has been tremendously difficult. We completed about 70% of the EventLists but work on that has been stopped for a while as the remaining Lists are really difficult to modify without breaking other stuff.

James

On Wed, Jul 2, 2008 at 9:42 AM, philk <phil.kursawe@...> wrote:

Ouch that is a pity. I guess thats due to performance optimizations?
Thanks for your quick response James, as always :)


James Lemieux wrote:
>
> Phil, unfortunately at the moment, the only way to access a deleted
> element
> is to maintain a private ArrayList inside of your ListEventListener. It
> essentially acts as a cache of the source list.
>
> Inelegant, but it'll keep you moving forward....
>
> James
>
> On Wed, Jul 2, 2008 at 5:28 AM, philk <phil.kursawe@...> wrote:
>
>>
>> I would like to get the deleted element inside my listener. But it seems
>> thet
>> ListEvent.getIndex() does not return the deleted element, as it has
>> already
>> been removed from the list when the listener is called.
>> Is there a way to get the item before its deletion?
>>
>> Thanks,
>> Phil
>> --
>> View this message in context:
>> http://www.nabble.com/Getting-the-deleted-element-tp18236362p18236362.html
>> Sent from the GlazedLists - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Getting-the-deleted-element-tp18236362p18241883.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


LightInTheBox - Buy quality products at wholesale price!