Skip to content

Commit

Permalink
Changed result display to text area element instead to allow for scro…
Browse files Browse the repository at this point in the history
…lling if text is too long.
  • Loading branch information
m133225 committed Sep 15, 2016
1 parent 4653f0e commit 95055c8
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/java/seedu/address/controller/ResultDisplay.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package seedu.address.controller;

import javafx.scene.Node;
import javafx.scene.control.TextArea;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import org.controlsfx.control.StatusBar;
import seedu.address.commons.FxViewUtil;

/**
Expand All @@ -12,7 +12,7 @@
public class ResultDisplay extends BaseUiPart {
public static final String HEADER_STATUS_BAR_ID = "resultDisplay";
private static final String STATUS_BAR_STYLE_SHEET = "result-display";
private StatusBar headerStatusBar;
private TextArea resultDisplayArea;

private static final String FXML = "ResultDisplay.fxml";

Expand All @@ -27,19 +27,20 @@ public static ResultDisplay load(Stage primaryStage, AnchorPane placeHolder) {
}

public void configure() {
headerStatusBar = new StatusBar();
headerStatusBar.setId(HEADER_STATUS_BAR_ID);
headerStatusBar.getStyleClass().removeAll();
headerStatusBar.getStyleClass().add(STATUS_BAR_STYLE_SHEET);
headerStatusBar.setText("");
FxViewUtil.applyAnchorBoundaryParameters(headerStatusBar, 0.0, 0.0, 0.0, 0.0);
mainPane.getChildren().add(headerStatusBar);
resultDisplayArea = new TextArea();
resultDisplayArea.setEditable(false);
resultDisplayArea.setId(HEADER_STATUS_BAR_ID);
resultDisplayArea.getStyleClass().removeAll();
resultDisplayArea.getStyleClass().add(STATUS_BAR_STYLE_SHEET);
resultDisplayArea.setText("");
FxViewUtil.applyAnchorBoundaryParameters(resultDisplayArea, 0.0, 0.0, 0.0, 0.0);
mainPane.getChildren().add(resultDisplayArea);
FxViewUtil.applyAnchorBoundaryParameters(mainPane, 0.0, 0.0, 0.0, 0.0);
placeHolder.getChildren().add(mainPane);
}

public StatusBar getHeaderStatusBarView() {
return headerStatusBar;
public TextArea getHeaderStatusBarView() {
return resultDisplayArea;
}

@Override
Expand All @@ -58,6 +59,6 @@ public String getFxmlPath() {
}

public void postMessage(String message) {
headerStatusBar.setText(message);
resultDisplayArea.setText(message);
}
}

0 comments on commit 95055c8

Please sign in to comment.