Search in sources :

Example 1 with GroupColumnsEvent

use of net.sourceforge.nattable.group.event.GroupColumnsEvent in project translationstudio8 by heartsome.

the class ColumnGroupsCommandHandler method handleGroupColumnsCommand.

public void handleGroupColumnsCommand(String columnGroupName) {
    try {
        List<Integer> selectedPositions = new ArrayList<Integer>();
        int[] fullySelectedColumns = new int[columnIndexesToPositionsMap.size()];
        int count = 0;
        for (Integer columnIndex : columnIndexesToPositionsMap.keySet()) {
            fullySelectedColumns[count++] = columnIndex.intValue();
            selectedPositions.add(columnIndexesToPositionsMap.get(columnIndex));
        }
        model.addColumnsIndexesToGroup(columnGroupName, fullySelectedColumns);
        selectionLayer.doCommand(new MultiColumnReorderCommand(selectionLayer, selectedPositions, selectedPositions.get(0).intValue()));
        selectionLayer.clear();
    } catch (Throwable t) {
    }
    contextLayer.fireLayerEvent(new GroupColumnsEvent(contextLayer));
}
Also used : GroupColumnsEvent(net.sourceforge.nattable.group.event.GroupColumnsEvent) MultiColumnReorderCommand(net.sourceforge.nattable.reorder.command.MultiColumnReorderCommand) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 GroupColumnsEvent (net.sourceforge.nattable.group.event.GroupColumnsEvent)1 MultiColumnReorderCommand (net.sourceforge.nattable.reorder.command.MultiColumnReorderCommand)1