public static CellStatus canDeleteCell(final @NotNull RadContainer grid, final int cellIndex, final boolean isRow) {
    check(grid, isRow, cellIndex);

    // Do not allow to delete the single row/column
    if(isRow && grid.getGridRowCount() <= grid.getGridLayoutManager().getMinCellCount()) {
      return CellStatus.Required;
    }
    else if(!isRow && grid.getGridColumnCount() <= grid.getGridLayoutManager().getMinCellCount()) {
      return CellStatus.Required;
    }

    boolean haveComponents = false;
    boolean haveOrigins = false;
    boolean haveSingleSpan = false;
    for (int i = 0; i < grid.getComponentCount(); i++) {
      final GridConstraints constraints = grid.getComponent(i).getConstraints();
      final int cell = constraints.getCell(isRow);
      final int span = constraints.getSpan(isRow);

      if (cellIndex >= cell && cellIndex < cell+span) {
        haveComponents = true;
        if (cellIndex == cell) {
          haveOrigins = true;
          if (span == 1) {
            haveSingleSpan = true;
          }
        }
      }
    }
    if (haveSingleSpan)
      return CellStatus.Required;
    if (haveOrigins)
      return CellStatus.CanShift;
    if (haveComponents)
      return CellStatus.Redundant;
    return CellStatus.Empty;
  }
public static CellStatus canDeleteCell(final @NotNull RadContainer grid, final int cellIndex, final boolean isRow)