List of utility methods to do List Move Item
void | moveRows(final List move Rows final int oldBlockStart = allRows.indexOf(rowsToMove.get(0)); allRows.removeAll(rowsToMove); if (index < oldBlockStart) { allRows.addAll(index, rowsToMove); } else if (index > oldBlockStart) { allRows.addAll(index - rowsToMove.size() + 1, rowsToMove); |
void | moveToFront(List aList, Object anObj) Move the given object to the front of the list. if (anObj != null) {
aList.remove(anObj);
aList.add(0, anObj);
|
int[] | moveTop(List list, int[] indices) moves the selected items to the top. int diff; if (canMoveUp(list, indices)) { diff = indices[0]; indices = moveItems(list, indices, diff, true); return indices; |
boolean | moveUp(final List move Up boolean result = false; if (list.size() >= 2) { int elemIndex = list.indexOf(toMoveUp); if (elemIndex > 0) { Collections.swap(list, elemIndex, elemIndex - 1); result = true; return result; |
void | moveUp(List move the given ones up in the specific list List<Object> listCopy = new ArrayList<Object>(list.size()); for (Object object : list) { listCopy.add(object); list.clear(); int count = listCopy.size(); Object current = null; Object floating = null; ... |
boolean | moveUp(List Move the selected items up one position in the list. boolean moved = false; int size = list.size(); for (int i = size - 1; i >= 0; i--) { T item = list.get(i); if (arrayContains(selectionIndexes, i)) { int nextUnselected = -1; int j = i - 1; while (j >= 0) { ... |
boolean | moveUpInList(List move Up In List if (isInArray(indices, 0)) { return false; Arrays.sort(indices); boolean changed = false; for (int i : indices) { changed |= moveUpInListSingleEntry(list, i); return changed; |
boolean | moveUpInListSingleEntry(List move Up In List Single Entry if (index == 0) { return false; E element = list.remove(index); list.add(index - 1, element); return true; |