<commit_before>package ui;

import java.util.function.Consumer;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.HBox;
import util.Utility;

public class RepositorySelector extends HBox {

    private final ComboBox<String> comboBox = new ComboBox<>();
    private final UI ui;
    private Consumer<String> onValueChangeCallback = e -> {};
    private boolean changesDisabled = false;

    public RepositorySelector(UI ui) {
        this.ui = ui;
        setupLayout();
        setupComboBox();
        getChildren().addAll(comboBox);
        this.setId("repositorySelector");
    }

    private void setupLayout() {
        setSpacing(5);
        setPadding(new Insets(5));
        setAlignment(Pos.BASELINE_LEFT);
        comboBox.setPrefWidth(250);
    }

    private void setupComboBox() {
        comboBox.setFocusTraversable(false);
        comboBox.setEditable(true);
        comboBox.valueProperty().addListener((observable, old, newVal) -> {
            if (Utility.isWellFormedRepoId(newVal) && !changesDisabled) {
                onValueChangeCallback.accept(newVal);
            }
        });
    }

    public void setOnValueChange(Consumer<String> callback) {
        assert callback != null;
        onValueChangeCallback = callback;
    }

    private void loadContents() {
        comboBox.getItems().addAll(ui.logic.getOpenRepositories());
    }

    public String getText() {
        return comboBox.getValue();
    }

    public void setText(String repoId) {
        changesDisabled = true;
        comboBox.setValue(repoId);
        changesDisabled = false;
    }

    public void refreshContents() {
        String text = getText();

        comboBox.getItems().clear();
        loadContents();

        setText(text);
    }
}
<commit_msg>changed #repositorySelector to the ComboBox inside RepositorySelector<commit_after>package ui;

import java.util.function.Consumer;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.HBox;
import util.Utility;

public class RepositorySelector extends HBox {

    private final ComboBox<String> comboBox = new ComboBox<>();
    private final UI ui;
    private Consumer<String> onValueChangeCallback = e -> {};
    private boolean changesDisabled = false;

    public RepositorySelector(UI ui) {
        this.ui = ui;
        setupLayout();
        setupComboBox();
        getChildren().addAll(comboBox);
        comboBox.setId("repositorySelector");
    }

    private void setupLayout() {
        setSpacing(5);
        setPadding(new Insets(5));
        setAlignment(Pos.BASELINE_LEFT);
        comboBox.setPrefWidth(250);
    }

    private void setupComboBox() {
        comboBox.setFocusTraversable(false);
        comboBox.setEditable(true);
        comboBox.valueProperty().addListener((observable, old, newVal) -> {
            if (Utility.isWellFormedRepoId(newVal) && !changesDisabled) {
                onValueChangeCallback.accept(newVal);
            }
        });
    }

    public void setOnValueChange(Consumer<String> callback) {
        assert callback != null;
        onValueChangeCallback = callback;
    }

    private void loadContents() {
        comboBox.getItems().addAll(ui.logic.getOpenRepositories());
    }

    public String getText() {
        return comboBox.getValue();
    }

    public void setText(String repoId) {
        changesDisabled = true;
        comboBox.setValue(repoId);
        changesDisabled = false;
    }

    public void refreshContents() {
        String text = getText();

        comboBox.getItems().clear();
        loadContents();

        setText(text);
    }
}

{'fraction_non_alphanumeric': 0.10632029994643813, 'fraction_numerical': 0.002678093197643278, 'mean_word_length': 2.7238285144566303, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '238596', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1026, 'n_words': 210}