<commit_before>#ifndef _LISTVIEW_H_
#define _LISTVIEW_H_

#include <UIElement.h>

#include <Command.h>
#include <CommandEvent.h>
#include <ValueEvent.h>

class ListView : public Element {
 public:
  enum ColumnType { TEXT = 1, NUMERIC, TIMESTAMP, ICON };
 ListView(int _id = 0, unsigned int _flags = 0) : Element(_id, _flags) { }

  bool isA(const std::string & className) const override {
    if (className == "ListView") return true;
    return Element::isA(className);
  }

  void addSheet(const std::string & name) {
    Command c(Command::ADD_SHEET, getInternalId());
    c.setTextValue(name);
    sendCommand(c);
  }

  void addColumn(const std::string & name, ColumnType type = TEXT) {
    Command c(Command::ADD_COLUMN, getInternalId());
    c.setTextValue(name);
    c.setValue(int(type));
    sendCommand(c);
  }<commit_msg>Add setSheet<commit_after>#ifndef _LISTVIEW_H_
#define _LISTVIEW_H_

#include <UIElement.h>

#include <Command.h>
#include <CommandEvent.h>
#include <ValueEvent.h>

class ListView : public Element {
 public:
  enum ColumnType { TEXT = 1, NUMERIC, TIMESTAMP, ICON };
 ListView(int _id = 0, unsigned int _flags = 0) : Element(_id, _flags) { }

  bool isA(const std::string & className) const override {
    if (className == "ListView") return true;
    return Element::isA(className);
  }

  void addSheet(const std::string & name) {
    Command c(Command::ADD_SHEET, getInternalId());
    c.setTextValue(name);
    sendCommand(c);
  }

  void setSheet(int sheet, const std::string & name) {
    Command c(Command::ADD_OPTION, getInternalId());
    c.setValue(sheet);
    c.setTextValue(name);
    sendCommand(c);
  }

  void addColumn(const std::string & name, ColumnType type = TEXT) {
    Command c(Command::ADD_COLUMN, getInternalId());
    c.setTextValue(name);
    c.setValue(int(type));
    sendCommand(c);
  }
{'fraction_non_alphanumeric': 0.1368307193077339, 'fraction_numerical': 0.003244997295835587, 'mean_word_length': 4.3468208092485545, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3260877', 'n_tokens_mistral': 635, 'n_tokens_neox': 622, 'n_words': 149}