public void setSortOrder(final Integer sortOrder) {
   this.sortOrder = sortOrder;
   // DTL-VK: Zdůvodů ukládání položky sortOrder do profilu musím posunout maximální id až za
   // nastavovanou hodnotu
   while (this.sortOrder > columnModel.getSortMaxIndex()) {
     columnModel.autoIncSortMaxIndex();
   }
 }
  /**
   * Setup sort type for this column and recalculate sortOrder of other columns to hold consistent
   * state.
   *
   * @param sortType new sort type
   */
  public void setSortType(final DLSortType sortType) {
    // if there was setted NATURAL and won't be then active sort order
    if (DLSortType.NATURAL.equals(this.sortType) && !DLSortType.NATURAL.equals(sortType)) {
      sortOrder = columnModel.autoIncSortMaxIndex();
    }
    // if there wasn't setted NATURAL and will be then deactive sort order
    if (!DLSortType.NATURAL.equals(this.sortType) && DLSortType.NATURAL.equals(sortType)) {
      columnModel.autoDecSortMaxIndex();
      for (DLColumnUnitModel unit : columnModel.getColumnModels()) {
        unit.autodecrementSortOrder(sortOrder);
      }
      sortOrder = 0;
    }

    setSortTypeDirectly(sortType);
  }