Search in sources :

Example 1 with GridWidgetHandlersOperation

use of org.uberfire.ext.wires.core.grids.client.widget.dnd.GridWidgetDnDHandlersState.GridWidgetHandlersOperation in project kie-wb-common by kiegroup.

the class ContextGrid method isRowDragPermitted.

@Override
public boolean isRowDragPermitted(final GridWidgetDnDHandlersState state) {
    final GridWidgetHandlersOperation operation = state.getOperation();
    if (operation == GridWidgetHandlersOperation.ROW_MOVE_PENDING) {
        final int lastRowIndex = model.getRowCount() - 1;
        final List<GridRow> rows = state.getActiveGridRows();
        return !rows.contains(model.getRow(lastRowIndex));
    }
    return true;
}
Also used : GridWidgetHandlersOperation(org.uberfire.ext.wires.core.grids.client.widget.dnd.GridWidgetDnDHandlersState.GridWidgetHandlersOperation) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) GridRow(org.uberfire.ext.wires.core.grids.client.model.GridRow)

Aggregations

DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)1 GridRow (org.uberfire.ext.wires.core.grids.client.model.GridRow)1 GridWidgetHandlersOperation (org.uberfire.ext.wires.core.grids.client.widget.dnd.GridWidgetDnDHandlersState.GridWidgetHandlersOperation)1