<commit_before><commit_msg>Create a new Alert Dialog that allows users to decide whether they would like their tasks to be transferred over to the new directory<commit_after>package seedu.task.alerts;

import java.util.Optional;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
//@@author A0142360U
public class TransferTaskAlert extends Alert {

    public static final String CHANGE_DIRECTORY_COMMAND_TITLE = "Change of Task Storage Directory";
    public static final String CHANGE_DIRECTORY_HEADER_TEXT = "Would you like your existing tasks to be transferred over to the new directory?";
    public static final ButtonType buttonTypeYes = new ButtonType("Yes");
    public static final ButtonType buttonTypeNo = new ButtonType("No");
    public static final ButtonType buttonTypeCancel = new ButtonType("Cancel");
    public static final String yes = "Yes";
    public static final String no = "No";
    public static final String noAction = "noAction";

    public TransferTaskAlert(AlertType alertType) {
        super(alertType);
    }

    public static String transferTaskOptionAlert() {

        try {
            Alert alert = new Alert(AlertType.CONFIRMATION);
            alert.setTitle(CHANGE_DIRECTORY_COMMAND_TITLE);
            alert.setHeaderText(CHANGE_DIRECTORY_HEADER_TEXT);
            alert.getButtonTypes().setAll(buttonTypeYes, buttonTypeNo,buttonTypeCancel);

            Optional<ButtonType> result = alert.showAndWait();
            if (result.get() == buttonTypeYes) {
                return yes;
            } else if (result.get() == buttonTypeNo){
                return no;
            }
            else {
                return noAction;
            }


        } catch (ExceptionInInitializerError | IllegalStateException e) {
            return noAction;
        }

    }

}
{'fraction_non_alphanumeric': 0.07399347116430903, 'fraction_numerical': 0.003808487486398259, 'mean_word_length': 2.9548387096774196, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '823323', 'n_tokens_mistral': 479, 'n_tokens_neox': 458, 'n_words': 146}