package seedu.task.ui;

import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import seedu.task.commons.core.LogsCenter;
import seedu.task.commons.util.FxViewUtil;

import java.util.logging.Logger;

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

    private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
    private static final String FXML = "HelpWindow.fxml";
    private static final String TITLE = "Help";
    //@@author A0153467Y
    private static final String COMMANDSUMMARY_URL = HelpWindow.class.getClassLoader().getResource("command-summary/CommandSummary.html").toExternalForm();
    //@@author
    private AnchorPane mainPane;

    private Stage dialogStage;

    public static HelpWindow load(Stage primaryStage) {
        logger.fine("Showing help page about the application.");
        HelpWindow helpWindow = UiPartLoader.loadUiPart(primaryStage, new HelpWindow());
        helpWindow.configure();
        return helpWindow;
    }

    @Override
    public void setNode(Node node) {
        mainPane = (AnchorPane) node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
    
    //@@author A0153467Y
    private void configure(){
        Scene scene = new Scene(mainPane, 700, 600);
        //Null passed as the parent stage to make it non-modal.
        dialogStage = createDialogStage(TITLE, null, scene);

        WebView browser = new WebView();
        browser.getEngine().load(COMMANDSUMMARY_URL);
        FxViewUtil.applyAnchorBoundaryParameters(browser, 0.0, 0.0, 0.0, 0.0);
        mainPane.getChildren().add(browser);
    }
    //@@author
    public void show() {
        dialogStage.showAndWait();
    }
}

@@ -451,16 +451,80 @@
 class);%0A
+    private static final String ICON = %22/images/help_icon.png%22;%0A
     priv
@@ -1334,38 +1334,9 @@
   %7D%0A
-    %0A    //@@author A0153467Y
 %0A
+
     
@@ -1539,17 +1539,61 @@
 scene);%0A
+        setIcon(dialogStage, ICON);%0A        
 %0A
-
         
@@ -1809,30 +1809,20 @@
 ;%0A    %7D%0A
+
     
-//@@author
 %0A    pub

Add back to icon for help page