here is a "hackish" solution:
� � � � collection1 := #(1 2 3 4 5) asOrderedCollection.�
� � � � collection2 := #($a $b $c $d $e) asOrderedCollection.�
� � � � list1 := ListModel new.�
� � � � list1 items: collection1.�
� � � � list1 dragEnabled: true.�
� � � � list1 dropEnabled: true.�
� � � � �list1�
� � � � � � � � acceptDropBlock: [ :transfer :event :source :receiver :index |�
� � � � � � � � � � � � | c1 c2 l1 l2 |�
� � � � � � � � � � � � l1 := source model model.�
� � � � � � � � � � � � c1 := l1 listItems.�
� � � � � � � � � � � � l2 := transfer source model model.�
� � � � � � � � � � � � c2 := l2 listItems.�
� � � � � � � � � � � � transfer passenger�
� � � � � � � � � � � � � � � � do: [ :e |�
� � � � � � � � � � � � � � � � � � � � c1 insert: e first before: index.�
� � � � � � � � � � � � � � � � � � � � c2 remove: e first ].�
� � � � � � � � � � � � l1 items: c1.�
collection1 removeAll; addAll: c1.
� � � � � � � � � � � � l2 items: c2.
collection2 removeAll; addAll: c2. ].�
� � � � list1 openWithSpec.�
� � � � list2 := ListModel new.�
� � � � list2 items: collection2.�
� � � � list2 dragEnabled: true.�
� � � � list2 dropEnabled: true.�
� � � � list2 acceptDropBlock: [ :transfer :event :source :receiver :index |�
self halt ].�
� � � � ^ list2 openWithSpec.
The problem here is that by default, the list items are sorted, setting the listItems with a copy.
Maybe it would be better to actually do not sort until one sets a real sortingBlock.
Ben