use of io.jmix.reports.entity.table.TemplateTableBand in project jmix by jmix-framework.
the class TableEditFragment method changeOrderBandsOfIndexes.
private void changeOrderBandsOfIndexes(int order) {
List<TemplateTableBand> items = tableBandsDc.getMutableItems();
TemplateTableBand currentItem = tableBandsDc.getItem();
TemplateTableBand itemToSwap = IterableUtils.find(items, e -> e.getPosition().equals(currentItem.getPosition() - order));
int currentItemPosition = currentItem.getPosition();
currentItem.setPosition(itemToSwap.getPosition());
itemToSwap.setPosition(currentItemPosition);
Collections.swap(items, itemToSwap.getPosition(), currentItem.getPosition());
}
Aggregations