Skip to content

Commit

Permalink
solved issue with lesson table wrong values..
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardodebenedictis committed Jun 25, 2018
1 parent 22bc2a9 commit d5f368e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ protected void updateItem(String item, boolean empty) {
styleProperty().unbind();
setStyle("");
} else {
EventTemplate et = l_ctx.get().getModel().events.get(getIndex());
TokenRow row = getTableView().getItems().get(getIndex());
EventTemplate et = l_ctx.get().getModel().events.stream().filter(evt -> evt.name.equals(row.getName())).findAny().get();
StudentContext student_ctx = Context.getContext().getStudentContext(l_ctx.get().getLesson().roles.get(et.role));
setText(student_ctx.getStudent().first_name + " " + student_ctx.getStudent().last_name);

TokenRow row = getTableView().getItems().get(getIndex());
styleProperty().bind(Bindings.createStringBinding(() -> {
if (row.getExecuted()) {
return "-fx-font-weight: bold;";
Expand All @@ -343,7 +343,8 @@ protected void updateItem(String item, boolean empty) {
styleProperty().unbind();
setStyle("");
} else {
EventTemplate et = l_ctx.get().getModel().events.get(getIndex());
TokenRow row = getTableView().getItems().get(getIndex());
EventTemplate et = l_ctx.get().getModel().events.stream().filter(evt -> evt.name.equals(row.getName())).findAny().get();
if (et instanceof TextEventTemplate) {
setText(((TextEventTemplate) et).content);
} else if (et instanceof URLEventTemplate) {
Expand All @@ -352,7 +353,6 @@ protected void updateItem(String item, boolean empty) {
setText(((QuestionEventTemplate) et).question);
}

TokenRow row = getTableView().getItems().get(getIndex());
styleProperty().bind(Bindings.createStringBinding(() -> {
if (row.getExecuted()) {
return "-fx-font-weight: bold;";
Expand Down

0 comments on commit d5f368e

Please sign in to comment.