@Test public void testMoveTwoRowsDown() { CommandUtils.moveRows(allRows, Arrays.asList(decisionRuleOne, decisionRuleTwo), 2); Assertions.assertThat(allRows).containsSequence(decisionRuleThree, decisionRuleOne, decisionRuleTwo); }
public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { 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); } }
CommandUtils { public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { 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); } } }
CommandUtils { public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { 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); } }  }
CommandUtils { public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { 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); } }  static void updateRowNumbers(final GridData uiModel,
                                        final IntStream rangeOfRowsToUpdate); static void moveRows(final List<T> allRows,
                                    final List<T> rowsToMove,
                                    final int index); static void moveComponentWidths(final int index,
                                           final int oldIndex,
                                           final List<Double> componentWidths,
                                           final List<Integer> uiColumnIndexes); static void updateParentInformation(final GridData uiModel); static Optional<GridCellValue<?>> extractGridCellValue(final GridCellTuple cellTuple); }
CommandUtils { public static <T> void moveRows(final List<T> allRows, final List<T> rowsToMove, final int index) { 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); } }  static void updateRowNumbers(final GridData uiModel,
                                        final IntStream rangeOfRowsToUpdate); static void moveRows(final List<T> allRows,
                                    final List<T> rowsToMove,
                                    final int index); static void moveComponentWidths(final int index,
                                           final int oldIndex,
                                           final List<Double> componentWidths,
                                           final List<Integer> uiColumnIndexes); static void updateParentInformation(final GridData uiModel); static Optional<GridCellValue<?>> extractGridCellValue(final GridCellTuple cellTuple);  }