Source:
<code>private void initMoveUpDownButtons(final Button moveUpButton, final Button moveDownButton, final AbstractTableViewer viewer) { moveUpButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<?> containments = (List<?>) eObject.eGet(structuralFeature, true); final EditingDomain editingDomain = getEditingDomain(eObject); final List<?> moveUpList = IStructuredSelection.class.cast(tableViewer.getSelection()) .toList(); for (final Object moveUpObject : <START> moveUpList) { <END> final int currentIndex = containments.indexOf(moveUpObject); if (currentIndex <= 0) { return; } editingDomain.getCommandStack() .execute( new MoveCommand(editingDomain, eObject, structuralFeature, currentIndex, currentIndex - 1)); } } }); moveDownButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<?> containments = (List<?>) eObject.eGet(structuralFeature, true); final EditingDomain editingDomain = getEditingDomain(eObject); final List<?> moveDownList = IStructuredSelection.class.cast(tableViewer.getSelection()) .toList(); Collections.reverse(moveDownList); final int maxIndex = containments.size() - 1; for (final Object moveDownObject : moveDownList) { final int currentIndex = containments.indexOf(moveDownObject); if (currentIndex < 0 || currentIndex == maxIndex) { return; } editingDomain.getCommandStack() .execute( new MoveCommand(editingDomain, eObject, structuralFeature, currentIndex, currentIndex + 1)); } } }); }</code><technical_language>I order this list based current indexes. Lets assume this list [0,1,2] due a table comparator tableViewer selection returns [2,1]. This give [0,1,2] instead of [1,2,0] question is, if this case is ;) applies for move</technical_language>

Target:
private void initMoveUpDownButtons(final Button moveUpButton, final Button moveDownButton, final AbstractTableViewer viewer) { moveUpButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<?> containments = (List<?>) eObject.eGet(structuralFeature, true); final EditingDomain editingDomain = getEditingDomain(eObject); @SuppressWarnings({ "rawtypes", "unchecked" }) final List<?> moveUpList = new ArrayList( IStructuredSelection.class.cast(tableViewer.getSelection()).toList()); sortSelectionBasedOnIndex(moveUpList, containments); for (final Object moveUpObject : moveUpList) { final int currentIndex = containments.indexOf(moveUpObject); if (currentIndex <= 0) { return; } editingDomain.getCommandStack() .execute( new MoveCommand(editingDomain, eObject, structuralFeature, currentIndex, currentIndex - 1)); } } }); moveDownButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { final List<?> containments = (List<?>) eObject.eGet(structuralFeature, true); final EditingDomain editingDomain = getEditingDomain(eObject); @SuppressWarnings({ "rawtypes", "unchecked" }) final List<?> moveDownList = new ArrayList( IStructuredSelection.class.cast(tableViewer.getSelection()).toList()); sortSelectionBasedOnIndex(moveDownList, containments); Collections.reverse(moveDownList); final int maxIndex = containments.size() - 1; for (final Object moveDownObject : moveDownList) { final int currentIndex = containments.indexOf(moveDownObject); if (currentIndex < 0 || currentIndex == maxIndex) { return; } editingDomain.getCommandStack() .execute( new MoveCommand(editingDomain, eObject, structuralFeature, currentIndex, currentIndex + 1)); } } }); }