package seedu.doit.ui;

import java.util.logging.Logger;

import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.layout.Region;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import seedu.doit.commons.core.LogsCenter;
import seedu.doit.commons.util.FxViewUtil;

/**
 * Controller for a help page
 */
public class HelpWindow extends UiPart<Region> {

    private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
    private static final String ICON = "/images/help_icon.png";
    private static final String FXML = "HelpWindow.fxml";
    private static final String TITLE = "Help";
    private static final String USERGUIDE_URL =
            "https://se-edu.github.io/addressbook-level4/docs/UserGuide.html";

    @FXML
    private WebView browser;

    private final Stage dialogStage;

    public HelpWindow() {
        super(FXML);
        Scene scene = new Scene(getRoot());
        //Null passed as the parent stage to make it non-modal.
        dialogStage = createDialogStage(TITLE, null, scene);
        dialogStage.setMaximized(true); //TODO: set a more appropriate initial size
        FxViewUtil.setStageIcon(dialogStage, ICON);

        browser.getEngine().load(USERGUIDE_URL);
        FxViewUtil.applyAnchorBoundaryParameters(browser, 0.0, 0.0, 0.0, 0.0);
    }

    public void show() {
        logger.fine("Showing help page about the application.");
        dialogStage.showAndWait();
    }
}

@@ -373,20 +373,17 @@
 ion%3E %7B%0A%0A
-    
+%09
 private 
@@ -451,20 +451,17 @@
 class);%0A
-    
+%09
 private 
@@ -512,20 +512,17 @@
 n.png%22;%0A
-    
+%09
 private 
@@ -567,20 +567,17 @@
 .fxml%22;%0A
-    
+%09
 private 
@@ -612,20 +612,17 @@
 %22Help%22;%0A
-    
+%09
 private 
@@ -661,64 +661,68 @@
 L =%0A
-            %22https://se-edu.github.io/addressbook-level4
+%09%09%09%22https://github.com/CS2103JAN2017-W14-B3/main/blob/master
 /doc
@@ -737,30 +737,22 @@
 ide.
-html%22;%0A%0A    
+md%22;%0A%0A%09
 @FXML%0A
-    
+%09
 priv
@@ -773,20 +773,17 @@
 owser;%0A%0A
-    
+%09
 private 
@@ -808,20 +808,17 @@
 Stage;%0A%0A
-    
+%09
 public H
@@ -831,24 +831,18 @@
 dow() %7B%0A
-        
+%09%09
 super(FX
@@ -846,24 +846,18 @@
 (FXML);%0A
-        
+%09%09
 Scene sc
@@ -884,24 +884,18 @@
 oot());%0A
-        
+%09%09
 //Null p
@@ -942,24 +942,23 @@
 -modal.%0A
-        
+%09%09this.
 dialogSt
@@ -1002,24 +1002,23 @@
 scene);%0A
-        
+%09%09this.
 dialogSt
@@ -1085,24 +1085,18 @@
 al size%0A
-        
+%09%09
 FxViewUt
@@ -1111,16 +1111,21 @@
 ageIcon(
+this.
 dialogSt
@@ -1137,24 +1137,23 @@
 ICON);%0A%0A
-        
+%09%09this.
 browser.
@@ -1185,24 +1185,18 @@
 E_URL);%0A
-        
+%09%09
 FxViewUt
@@ -1228,16 +1228,21 @@
 ameters(
+this.
 browser,
@@ -1267,19 +1267,13 @@
 0);%0A
-    %7D%0A%0A    
+%09%7D%0A%0A%09
 publ
@@ -1289,24 +1289,18 @@
 how() %7B%0A
-        
+%09%09
 logger.f
@@ -1352,16 +1352,15 @@
 %22);%0A
-        
+%09%09this.
 dial
@@ -1386,12 +1386,9 @@
 ();%0A
-    
+%09
 %7D%0A%7D%0A

Update help botton to open our user guide