package controller;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import model.FileManager;
import model.FileManagerInterface;

import java.util.Optional;

/**
 * Created by 효민 on 2016-05-23.
 */
public class Caution {


    ButtonType buttonTypeSave = new ButtonType("저장");
    ButtonType buttonTypeNotSave = new ButtonType("저장 안 함");
    ButtonType buttonTypeClose = new ButtonType("닫기");


    public ButtonType getSavebtn(){
        return buttonTypeSave;
    }


    public  Optional<ButtonType> getSaveWindow(FileManagerInterface.SideOfEditor side){

        Alert alert = new Alert(Alert.AlertType.WARNING);
        alert.setTitle("Simple Merge - 소공 2팀");
        alert.setHeaderText(null);
        if(FileManager.getFileManagerInterface().getFilePath(side) == null)
            alert.setContentText("새로운 파일로 저장하시겠습니까?");
        else
            alert.setContentText("변경 사항을 저장하시겠습니까?");

        alert.getButtonTypes().setAll(buttonTypeSave, buttonTypeNotSave);

        Optional<ButtonType> result = alert.showAndWait();

        return result;
    }
    public void noticeSaveWindow(FileManagerInterface.SideOfEditor side) {
        Alert alert = new Alert(Alert.AlertType.ERROR);
        alert.setTitle("Simple Merge - 소공 2팀");
        alert.setHeaderText(null);
        if(side == FileManagerInterface.SideOfEditor.Left)
            alert.setContentText("Left side File - 저장에 실패하였습니다.");
        else
            alert.setContentText("Right side File - 저장에 실패하였습니다.");
        alert.getButtonTypes().setAll(buttonTypeClose);
        alert.showAndWait();
    }


}

@@ -244,24 +244,32 @@
 ion %7B%0A%0A%0A    
+private 
 ButtonType b
@@ -302,32 +302,40 @@
 Type(%22%EC%A0%80%EC%9E%A5%22);%0A    
+private 
 ButtonType butto
@@ -379,16 +379,24 @@
 %22);%0A    
+private 
 ButtonTy
@@ -1622,10 +1622,277 @@
     %7D%0A%0A%0A
+    public void noticeMergeFailure()%7B%0A%0A        Alert alert = new Alert(Alert.AlertType.INFORMATION);%0A        alert.setTitle(%22Simple Merge - %EC%86%8C%EA%B3%B5 2%ED%8C%80%22);%0A        alert.setHeaderText(null);%0A        alert.setContentText(%22%EB%B3%B5%EC%82%AC%EC%97%90 %EC%8B%A4%ED%8C%A8%ED%95%98%EC%98%80%EC%8A%B5%EB%8B%88%EB%8B%A4.%22);%0A%0A        alert.showAndWait();%0A    %7D%0A%0A
 %7D%0A

add method in CautionClass