Allow viewing summary for a selected row#44
Conversation
|
@sebastianquek for your review. |
sebastianquek
left a comment
There was a problem hiding this comment.
Overall, looks good! 👍
Do take note of the formatting, I've followed the Java Coding Standards as mentioned in CS2103.
src/main/java/gui/MainApp.java
Outdated
|
|
||
| private void addCommandBar(MainApp mainApp) { | ||
| rootLayout.setBottom(new CommandBarController(mainApp)); | ||
| commandBarController = new CommandBarController(mainApp); |
There was a problem hiding this comment.
Whitespace formatting
There was a problem hiding this comment.
What's whitespace formatting? Is it a different problem from tab indentation?
Also do you indent empty lines?
There was a problem hiding this comment.
It's the same as tab indentation, use 4 spaces.
No, do not indent empty lines!
src/main/java/gui/MainApp.java
Outdated
| handleEnterPress(commandBarController, userInput); | ||
| handleEnterPress(userInput); | ||
| } else if (key == KeyCode.ESCAPE) { | ||
| addSummary(this); |
There was a problem hiding this comment.
Use 4 spaces to indent, not tabs
src/main/java/gui/MainApp.java
Outdated
| } | ||
|
|
||
| public void handleMouseClick(AuthorBean selectedAuthor) { | ||
| String authorName = selectedAuthor.nameProperty().get(); |
There was a problem hiding this comment.
Whitespace formatting, this includes the several lines after this.
| private static final String OVERVIEW_LAYOUT_FXML = "/main/resources/layouts/Summary.fxml"; | ||
|
|
||
| public SummaryController(Collection<Author> inputSummaryData) { | ||
| public SummaryController(MainApp mainApp, Collection<Author> inputSummaryData) { |
|
|
||
| summaryTable.setItems(summaryData); | ||
| summaryTable.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { | ||
| mainApp.handleMouseClick(newValue); |
|
Fixed the tab indentation with autoformatting, which removed a few pre-existing empty line indentation as well, let me know if I missed anything. |
|
|
||
| summaryTable.setItems(summaryData); | ||
| summaryTable.getSelectionModel().selectedItemProperty() | ||
| .addListener((observableValue, oldValue, newValue) -> { |
There was a problem hiding this comment.
Could you also indent this block to match the previous statement's dot separator?
|
@riwu Sure, you can squash the commits into one! Thanks!! |
Allows clicking on a row to view the contribution statistics of the author associated with the row.
Pressing the escape key will return to the summary.