private Component createFlatComponent(DualViewColumnInfo[] columns) {

    ArrayList<ColumnInfo> shownColumns = new ArrayList<>();

    for (DualViewColumnInfo column : columns) {
      if (column.shouldBeShownIsTheTable()) {
        shownColumns.add(column);
      }
    }

    ListTableModel flatModel = new ListTableModel(shownColumns.toArray(ColumnInfo.EMPTY_ARRAY));
    //noinspection unchecked
    myFlatView = new TableView(flatModel) {
      @Override
      public TableCellRenderer getCellRenderer(int row, int column) {
        return createWrappedRenderer(super.getCellRenderer(row, column));
      }

      @Override
      public @NotNull Component prepareRenderer(@NotNull TableCellRenderer renderer, int row, int column) {
        final Component c = super.prepareRenderer(renderer, row, column);
        if (c instanceof JComponent && !myFlatView.getCellSelectionEnabled()) {
          ((JComponent)c).setBorder(null);
        }
        return c;
      }

      @Override
      public void doLayout() {
        try {
          mySuppressStore = true;
          super.doLayout();
        }
        finally {
          mySuppressStore = false;
        }
      }

      @Override
      public void updateColumnSizes() {
        // suppress automatic layout, use stored values instead
      }
    };
    myFlatView.setCellSelectionEnabled(false);
    myFlatView.setColumnSelectionAllowed(false);
    myFlatView.setRowSelectionAllowed(true);

    refreshFlatModel();

    JPanel result = new JPanel(new BorderLayout());
    result.add(ScrollPaneFactory.createScrollPane(myFlatView), BorderLayout.CENTER);
    return result;
  }
private Component createFlatComponent(DualViewColumnInfo[] columns)