<commit_before>package de.factoryfx.javafx.view;

import java.util.Optional;

import de.factoryfx.javafx.view.container.ViewsDisplayWidget;
import de.factoryfx.javafx.widget.CloseAwareWidget;
import de.factoryfx.javafx.widget.Widget;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.scene.Node;
import org.controlsfx.glyphfont.Glyph;

public class View implements Widget {

    public final SimpleStringProperty title = new SimpleStringProperty();
    public final SimpleStringProperty dynamicAdditionalTitle = new SimpleStringProperty();

    public final SimpleObjectProperty<Glyph> icon = new SimpleObjectProperty<>();
    public final Widget widget;
    protected ViewsDisplayWidget viewsDisplayWidget;
    boolean isShowing;
    Node cachedContent;
    Optional<Runnable> closeListener = Optional.empty();

    public View(String title, ViewsDisplayWidget viewsDisplayWidget, Widget widget) {
        this.title.set(title);
        this.viewsDisplayWidget = viewsDisplayWidget;
        this.widget = widget;
    }

    public void close() {
        if (widget instanceof CloseAwareWidget) {
            ((CloseAwareWidget) widget).closeNotifier();
        }
        isShowing = false;
        viewsDisplayWidget.close(this);
        closeListener.ifPresent(runnable -> runnable.run());
    }

    @Override
    public Node createContent() {
        return widget.createContent();
    }

    public Node getCachedContent() {
        if (cachedContent == null) {
            cachedContent = createContent();
        }
        return cachedContent;
    }

    public boolean isShowing() {
        return isShowing;
    }

    public void setCloseListener(Runnable closeListener) {
        this.closeListener = Optional.of(closeListener);
    }

    public void show() {
        viewsDisplayWidget.show(this);
        isShowing = true;
    }

}<commit_msg>cache disabled<commit_after>package de.factoryfx.javafx.view;

import java.util.Optional;

import de.factoryfx.javafx.view.container.ViewsDisplayWidget;
import de.factoryfx.javafx.widget.CloseAwareWidget;
import de.factoryfx.javafx.widget.Widget;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.scene.Node;
import org.controlsfx.glyphfont.Glyph;

public class View implements Widget {

    public final SimpleStringProperty title = new SimpleStringProperty();
    public final SimpleStringProperty dynamicAdditionalTitle = new SimpleStringProperty();

    public final SimpleObjectProperty<Glyph> icon = new SimpleObjectProperty<>();
    public final Widget widget;
    protected ViewsDisplayWidget viewsDisplayWidget;
    boolean isShowing;
    Node cachedContent;
    Optional<Runnable> closeListener = Optional.empty();

    public View(String title, ViewsDisplayWidget viewsDisplayWidget, Widget widget) {
        this.title.set(title);
        this.viewsDisplayWidget = viewsDisplayWidget;
        this.widget = widget;
    }

    public void close() {
        if (widget instanceof CloseAwareWidget) {
            ((CloseAwareWidget) widget).closeNotifier();
        }
        isShowing = false;
        viewsDisplayWidget.close(this);
        closeListener.ifPresent(runnable -> runnable.run());
    }

    @Override
    public Node createContent() {
        return widget.createContent();
    }

    public Node getCachedContent() {
        //TODO chache even good?
//        if (cachedContent == null) {
//            cachedContent = createContent();
//        }
        return cachedContent;
    }

    public boolean isShowing() {
        return isShowing;
    }

    public void setCloseListener(Runnable closeListener) {
        this.closeListener = Optional.of(closeListener);
    }

    public void show() {
        viewsDisplayWidget.show(this);
        isShowing = true;
    }

}
{'fraction_non_alphanumeric': 0.08822016460905349, 'fraction_numerical': 0.0, 'mean_word_length': 3.2642543859649122, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5451751', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1013, 'n_words': 233}