package org.cbrnrd.alertfx;

import javafx.scene.control.Alert;
import javafx.scene.control.DialogPane;
import javafx.stage.StageStyle;

/**
 * TODO javadoc
 */
public class Warn {

    String warning;
    Alert alert;
    String header = "Warning!";

    /**
     * The style of the stage
     */
    public StageStyle style = StageStyle.DECORATED;


    public Warn(String warning){
        this.warning = warning;
    }

    public void setHeader(String head){
        alert.setHeaderText(head);
    }

    public void setSize(double x, double y){
        alert.setX(x);
        alert.setY(y);
    }

    /**
     * Applies a custom css file to the alert
     * @param path The full path of the css file
     */
    public void applyCss(String path){
        DialogPane dialogPane = alert.getDialogPane();
        dialogPane.getStylesheets().add(getClass().getResource(path).toExternalForm());
        dialogPane.getStyleClass().add(path.replace(".css", ""));  // Shouldn't have extension
    }

    public void show(){
        Alert alert = new Alert(Alert.AlertType.WARNING);
        alert.initStyle(style);
        alert.setContentText(warning);
        alert.setHeaderText(header);
        alert.showAndWait();
    }

    public void showNonblock(){
        Alert alert = new Alert(Alert.AlertType.WARNING);
        alert.initStyle(style);
        alert.setContentText(warning);
        alert.setHeaderText(header);
        alert.show();
    }

}

@@ -141,20 +141,29 @@
 %0A * 
-TODO javadoc
+Shows a warning alert
 %0A */
@@ -434,85 +434,302 @@
     
-public void setHeader(String head)%7B%0A        alert.setHeaderText(head);%0A    %7D%0A
+/**%0A    * Changes the header of the alert%0A    * @param head The header to show%0A    */%0A    public void setHeader(String head)%7B%0A        alert.setHeaderText(head);%0A    %7D%0A%0A    /**%0A    * Changes the size of the alert%0A    * @param x The size on the x-axis%0A    * @param y The size on the y-axis%0A    */
 %0A   
@@ -1210,32 +1210,69 @@
 xtension%0A    %7D%0A%0A
+    /**%0A    * Shows the alert%0A    */%0A
     public void 
@@ -1477,24 +1477,85 @@
 t();%0A    %7D%0A%0A
+    /**%0A    * Shows the alert but isn't always on top%0A    */%0A
     public v

Add javadoc for warn