void (final GuiEditor editor, final List<? extends RadComponent> input, final AnActionEvent e) { List<RadComponent> selection = FormEditingUtil.remapToActionTargets(input); RadContainer parent = FormEditingUtil.getSelectionParent(selection); assert parent != null; List<RadComponent> duplicates = new ArrayList<>(); Map<RadComponent, RadComponent> duplicateMap = new HashMap<>(); IntSet insertedRows = new IntOpenHashSet(); boolean incrementRow = true; if (selection.size() > 1 && canDuplicate(selection, false) && FormEditingUtil.getSelectionBounds(selection).width == 1) { incrementRow = false; } for(RadComponent c: selection) { final int row = c.getConstraints().getCell(incrementRow); int rowSpan = c.getConstraints().getSpan(incrementRow); int insertIndex = parent.indexOfComponent(c); if (parent.getLayoutManager().isGrid()) { if (!insertedRows.contains(row) && !isSpaceBelowEmpty(c, incrementRow)) { insertedRows.add(row); parent.getGridLayoutManager().copyGridCells(parent, parent, incrementRow, row, rowSpan, row + rowSpan); } } List<RadComponent> copyList = CutCopyPasteSupport.copyComponents(editor, Collections.singletonList(c)); if (copyList != null) { RadComponent copy = copyList.get(0); if (parent.getLayoutManager().isGrid()) { copy.getConstraints().setCell(incrementRow, row + rowSpan + parent.getGridLayoutManager().getGapCellCount()); copy.getConstraints().setSpan(incrementRow, rowSpan); } parent.addComponent(copy, insertIndex+1); fillDuplicateMap(duplicateMap, c, copy); duplicates.add(copy); } } adjustDuplicates(duplicateMap); FormEditingUtil.selectComponents(editor, duplicates); }