Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsUnable to perform selection when row is added or removed from event list
https://www.eclipse.org/forums/index.php/mv/msg/618112/1208793/#msg_1208793
I am trying to select the row , after adding it in a event list but it get refreshed.
On investigating the problem i found, whenever there has been change in the event list (row add/remove) then the whole stack of layers get refreshed including selection layer so my selection gets also refreshed.
I have tried several different things like performing selection in a separate thread after adding the row but so far not successful to find some generic solution.
Is there any way through which i can control or restrict layer refresh?
All i want is to perform some selection after add/remove/update in the event list.
]]>SD Khan2013-11-25T07:19:30-00:00Re: Unable to perform selection when row is added or removed from event list
https://www.eclipse.org/forums/index.php/mv/msg/618112/1208856/#msg_1208856
The issue is dependent on SelectionLayerStructuralChangeEventHandler which simply clears the selection on refreshes.
You could implement a different handler and register it against the SelectionLayer that is more intelligent and checks if the selection has really changed or if it is valid from the structural point. I thought I posted something like a PreserveSelectionLayerStructuralChangeEventHandler a while ago. Not sure what side effects might occur. Need to be tested well.
You could also try if adding a listener to the NatTable helps that executes the selection after the list change processing is done.]]>Dirk Fauth2013-11-25T07:58:53-00:00Re: Unable to perform selection when row is added or removed from event list
https://www.eclipse.org/forums/index.php/mv/msg/618112/1209022/#msg_1209022
Thanks,
Safdar Khan
]]>SD Khan2013-11-25T09:47:13-00:00Re: Unable to perform selection when row is added or removed from event list
https://www.eclipse.org/forums/index.php/mv/msg/618112/1209275/#msg_1209275
i have checked your implemented class
"PreserveSelectionLayerStructuralChangeEventHandler" it work when change in the event list occurs, i.e keep the selection but now does not clear or move selection accordingly when rows are sorted.
Regards,
Safdar Khan
]]>SD Khan2013-11-25T12:30:38-00:00Re: Unable to perform selection when row is added or removed from event list
https://www.eclipse.org/forums/index.php/mv/msg/618112/1209300/#msg_1209300
Quote:
Not sure what side effects might occur.
If you have row id's you could implement something that remembers the selected rows via id and reapply or skip clearing. Otherwise it will get complicated.
That's why we will address this in the future architecture. If you find another solution in the current architecture, feel free to contribute.]]>Dirk Fauth2013-11-25T12:42:40-00:00