@@ -15,8 +15,6 @@ public class SearchBox extends AnchorPane {
     private TextField searchField;
     private Button clearButton;
 
-    private static final String cleanButtonIcon = "icons/mainwindow/general/edit-clear.png";
-
     public SearchBox(ThemeManager themeManager, Consumer<String> onSearch, Runnable onClear) {
         this.searchField = new TextField();
 
package org.phoenicis.javafx.views.mainwindow.ui;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import org.phoenicis.javafx.views.common.ThemeManager;

import javafx.beans.property.StringProperty;
import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;

import java.util.function.Consumer;

public class SearchBox extends AnchorPane {
    private TextField searchField;
    private Button clearButton;

    private static final String cleanButtonIcon = "icons/mainwindow/general/edit-clear.png";

    public SearchBox(ThemeManager themeManager, Consumer<String> onSearch, Runnable onClear) {
        this.searchField = new TextField();

        this.searchField.getStyleClass().add("searchBar");
        this.searchField.prefHeightProperty().bind(this.prefHeightProperty());
        this.searchField.prefWidthProperty().bind(this.prefWidthProperty());
        this.searchField.textProperty().addListener(event -> onSearch.accept(getText()));

        AnchorPane.setLeftAnchor(searchField, 0.0);
        AnchorPane.setRightAnchor(searchField, 0.0);

        this.clearButton = new Button();
        this.clearButton.getStyleClass().add("searchCleanButton");
        this.clearButton.styleProperty().set(
                "-fx-graphic: url('" + themeManager.getResourceUrl(SearchBox.cleanButtonIcon) + "');");
        this.clearButton.setOnMouseClicked(event -> {
            this.searchField.clear();
            onClear.run();
        });

        AnchorPane.setRightAnchor(clearButton, 0.0);

        this.getChildren().addAll(searchField, clearButton);
    }

    public StringProperty textProperty() {
        return this.searchField.textProperty();
    }

    public String getText() {
        return this.searchField.getText();
    }
}

I think you can/should also remove the `ThemeManager` here.