Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
chuayupeng committed Nov 5, 2016
1 parent d45c694 commit 461705e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
package seedu.todo.commons.events.ui;

import seedu.todo.commons.events.BaseEvent;
import seedu.todo.model.task.ReadOnlyTask;

public class SummaryPanelSelectionEvent extends BaseEvent {

public SummaryPanelSelectionEvent() {}
ReadOnlyTask task;

public SummaryPanelSelectionEvent(ReadOnlyTask task) {
this.task = task;
}

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
package seedu.todo.commons.events.ui;

import seedu.todo.commons.events.BaseEvent;
import seedu.todo.model.task.ReadOnlyTask;

public class WeekSummaryPanelSelectionEvent extends BaseEvent {

public WeekSummaryPanelSelectionEvent() {}
ReadOnlyTask task;

public WeekSummaryPanelSelectionEvent(ReadOnlyTask task) {
this.task = task;
}

@Override
public String toString() {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/todo/ui/SummaryPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import seedu.todo.commons.events.ui.SummaryPanelSelectionEvent;
import seedu.todo.commons.events.ui.TagPanelSelectionEvent;
import seedu.todo.model.task.ReadOnlyTask;

import java.time.LocalDate;
Expand Down Expand Up @@ -84,7 +83,7 @@ public void scrollTo(int index) {
private void setEventHandlerForSelectionChangeEvent() {
summaryListView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
raise(new SummaryPanelSelectionEvent());
raise(new SummaryPanelSelectionEvent(newValue));
}
});
}
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/seedu/todo/ui/WeekSummaryPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import seedu.todo.commons.core.LogsCenter;
import seedu.todo.commons.events.ui.WeekSummaryPanelSelectionEvent;
import seedu.todo.model.task.ReadOnlyTask;

import java.time.LocalDate;
import java.util.logging.Logger;

/**
* Panel containing the list of tasks.
*/
public class WeekSummaryPanel extends UiPart {
private final Logger logger = LogsCenter.getLogger(WeekSummaryPanel.class);
private static final String FXML = "WeekSummaryPanel.fxml";
private VBox panel;
private AnchorPane placeHolderPane;
Expand Down Expand Up @@ -84,7 +80,7 @@ public void scrollTo(int index) {
private void setEventHandlerForSelectionChangeEvent() {
weekSummaryListView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
raise(new WeekSummaryPanelSelectionEvent());
raise(new WeekSummaryPanelSelectionEvent(newValue));
}
});
}
Expand Down

0 comments on commit 461705e

Please sign in to comment.