Skip to content

Commit

Permalink
tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyyx committed Nov 7, 2016
2 parents 01efe85 + eabd1df commit b3d2fb1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/seedu/task/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,21 @@

/**
* Controller for a help page
* TODO: add auto cache of new local html if internet access available
*/
public class HelpWindow extends UiPart {

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 =
"/Userguide.html";

"/Userguide.html";
private AnchorPane mainPane;

private Stage dialogStage;

public static HelpWindow load(Stage primaryStage) {
logger.info("Showing help page about the application.");
logger.fine("Showing help page about the application.");
HelpWindow helpWindow = UiPartLoader.loadUiPart(primaryStage, new HelpWindow());
helpWindow.configure();
return helpWindow;
Expand All @@ -50,12 +47,10 @@ private void configure(){
Scene scene = new Scene(mainPane);
//Null passed as the parent stage to make it non-modal.
dialogStage = createDialogStage(TITLE, null, scene);
dialogStage.setMaximized(true);
dialogStage.setMaximized(true); //TODO: set a more appropriate initial size
setIcon(dialogStage, ICON);

WebView browser = new WebView();
String path = MainApp.class.getProtectionDomain().getCodeSource().getLocation().getFile()+USERGUIDE_URL;
logger.info("Opening help popup from: " + path);
WebView browser = new WebView();
browser.getEngine().load(MainApp.class.getResource(USERGUIDE_URL).toExternalForm());
FxViewUtil.applyAnchorBoundaryParameters(browser, 0.0, 0.0, 0.0, 0.0);
mainPane.getChildren().add(browser);
Expand Down

0 comments on commit b3d2fb1

Please sign in to comment.