Search in sources :

Example 6 with TemplateTableBand

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());
}
Also used : TemplateTableBand(io.jmix.reports.entity.table.TemplateTableBand)

Aggregations

TemplateTableBand (io.jmix.reports.entity.table.TemplateTableBand)6 TemplateTableColumn (io.jmix.reports.entity.table.TemplateTableColumn)3 Subscribe (io.jmix.ui.screen.Subscribe)2 BandData (com.haulmont.yarg.structure.BandData)1 KeyValueEntity (io.jmix.core.entity.KeyValueEntity)1 EntityMap (io.jmix.reports.app.EntityMap)1 JmixTableData (io.jmix.reports.entity.JmixTableData)1 TemplateTableDescription (io.jmix.reports.entity.table.TemplateTableDescription)1 RegionProperty (io.jmix.reports.entity.wizard.RegionProperty)1 ReportRegion (io.jmix.reports.entity.wizard.ReportRegion)1 ReportingException (io.jmix.reports.exception.ReportingException)1 Install (io.jmix.ui.screen.Install)1 LinkedList (java.util.LinkedList)1