Search in sources :

Example 6 with ColumnPositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.ColumnPositionCoordinate in project nebula.widgets.nattable by eclipse.

the class MultiColumnReorderCommand method convertToTargetLayer.

@Override
public boolean convertToTargetLayer(ILayer targetLayer) {
    List<ColumnPositionCoordinate> convertedFromColumnPositionCoordinates = new ArrayList<ColumnPositionCoordinate>(this.fromColumnPositionCoordinates.size());
    for (ColumnPositionCoordinate fromColumnPositionCoordinate : this.fromColumnPositionCoordinates) {
        ColumnPositionCoordinate convertedFromColumnPositionCoordinate = LayerCommandUtil.convertColumnPositionToTargetContext(fromColumnPositionCoordinate, targetLayer);
        if (convertedFromColumnPositionCoordinate != null) {
            convertedFromColumnPositionCoordinates.add(convertedFromColumnPositionCoordinate);
        }
    }
    ColumnPositionCoordinate targetToColumnPositionCoordinate = LayerCommandUtil.convertColumnPositionToTargetContext(this.toColumnPositionCoordinate, targetLayer);
    if (convertedFromColumnPositionCoordinates.size() > 0 && targetToColumnPositionCoordinate != null) {
        this.fromColumnPositionCoordinates = convertedFromColumnPositionCoordinates;
        this.toColumnPositionCoordinate = targetToColumnPositionCoordinate;
        return true;
    } else {
        return false;
    }
}
Also used : ColumnPositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.ColumnPositionCoordinate) ArrayList(java.util.ArrayList)

Aggregations

ColumnPositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.ColumnPositionCoordinate)6 RowPositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.RowPositionCoordinate)2 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)2 ArrayList (java.util.ArrayList)1 PositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate)1 SelectRegionCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectRegionCommand)1