Search in sources :

Example 1 with GroupColumnsEvent

use of org.eclipse.nebula.widgets.nattable.group.event.GroupColumnsEvent in project nebula.widgets.nattable by eclipse.

the class ColumnGroupsCommandHandler method handleGroupColumnsCommand.

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

Aggregations

ArrayList (java.util.ArrayList)1 GroupColumnsEvent (org.eclipse.nebula.widgets.nattable.group.event.GroupColumnsEvent)1 MultiColumnReorderCommand (org.eclipse.nebula.widgets.nattable.reorder.command.MultiColumnReorderCommand)1 Point (org.eclipse.swt.graphics.Point)1