package be.iminds.ilabt.jfed.experimenter_gui.ui;

import javafx.beans.NamedArg;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.text.TextFlow;

/**
 * Alert that supports TextFlows instead of strings
 */
public class TextFlowAlert extends Alert {

    public TextFlowAlert(@NamedArg("alertType") AlertType alertType) {
        super(alertType);
        getDialogPane().setContent(new TextFlow());
    }

    public TextFlowAlert(@NamedArg("alertType") AlertType alertType, TextFlow textFlow) {
        super(alertType);
        getDialogPane().setContent(textFlow);
    }

    public TextFlowAlert(@NamedArg("alertType") AlertType alertType, TextFlow textFlow, ButtonType... buttons) {
        super(alertType, "", buttons);
        getDialogPane().setContent(textFlow);
    }

    public TextFlow getTextFlow() {
        return (TextFlow) getDialogPane().getContent();
    }

    public void setTextFlow(TextFlow textFlow){
        getDialogPane().setContent(textFlow);
    }

}
