Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ufk-dev] ObservableListModel multi element change problem

Could this be the real solution:

fireContentsChanged(ObservableListModel.this, 0, Math.max(oldSize,newSize))?

Tom


Am 16.08.11 08:43, schrieb Tom Schindl:
> Hi,
> 
> I was not sure myself so you might be perfectly right. Can you please
> post the total code? I think though that the test should be if oldSize >
> newSize and not !=0 because then the add will only work for the first
> time not?
> 
> Tom
> 
> Am 16.08.11 08:25, schrieb Max Gordienko:
>> Hi Tom,
>>
>> Thank you very much for you update!
>>
>> But I'm not sure about the fireContentsChanged() call. It informs the
>> listeners about a model elements change, not about additions/removals.
>> In my scenario it does not handle addition of multiple elements very well.
>>
>> I use this code to notify the listeners:
>>
>> if (oldSize != 0) {
>> 	fireIntervalRemoved(ObservableListModel.this, 0, oldSize - 1);
>> }
>> if (newSize != 0) {
>> 	fireIntervalAdded(ObservableListModel.this, 0, newSize - 1);
>> }
>>
>> Extremely inefficient, but it works for me.
>> What do you think?
>> Thanks!
>>
>>   Max
>> _______________________________________________
>> ufk-dev mailing list
>> ufk-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/ufk-dev
> 
> _______________________________________________
> ufk-dev mailing list
> ufk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ufk-dev



Back to the top