31 lines
743 B
Java
31 lines
743 B
Java
package envoy.client.ui;
|
|
|
|
import envoy.data.User;
|
|
import javafx.scene.control.Label;
|
|
import javafx.scene.control.ListCell;
|
|
import javafx.scene.layout.VBox;
|
|
|
|
/**
|
|
* Project: <strong>envoy-client</strong><br>
|
|
* File: <strong>UserListCell.java</strong><br>
|
|
* Created: <strong>28.03.2020</strong><br>
|
|
*
|
|
* @author Kai S. K. Engelbart
|
|
* @since Envoy Client v0.1-beta
|
|
*/
|
|
public class UserListCell extends ListCell<User> {
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
@Override
|
|
protected void updateItem(User user, boolean empty) {
|
|
super.updateItem(user, empty);
|
|
if (!empty && user != null) {
|
|
final Label name = new Label(user.getName());
|
|
final Label status = new Label(user.getStatus().toString());
|
|
setGraphic(new VBox(name, status));
|
|
}
|
|
}
|
|
}
|