blob: 0e1dea7b01fb80ec629f75e11b501c33a93220ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package market.guess.ui.desktop.components;
import javafx.css.PseudoClass;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import market.guess.ui.desktop.model.UserEventRow;
import market.guess.ui.desktop.util.Views;
public class UserEventItemView extends HBox {
private static final PseudoClass NEGATIVE = PseudoClass.getPseudoClass("negative");
@FXML private Label nameLabel;
@FXML private Label roleLabel;
@FXML private Label typeLabel;
@FXML private Label yesLabel;
@FXML private Label noLabel;
@FXML private Label plLabel;
public UserEventItemView() {
Views.loadRoot(this, "user_event_item.fxml");
}
public UserEventItemView(UserEventRow ev) {
this();
update(ev);
}
public void update(UserEventRow ev) {
nameLabel.setText(ev.eventName());
roleLabel.setText(ev.role());
typeLabel.setText(ev.type());
yesLabel.setText(String.valueOf(ev.yes()));
noLabel.setText(String.valueOf(ev.no()));
plLabel.setText(ev.pl());
plLabel.pseudoClassStateChanged(NEGATIVE, ev.pl().startsWith("-"));
}
}
|