mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 10:41:26 +00:00
null-safe status indicators
This commit is contained in:
@@ -56,13 +56,8 @@ public class DirectoryListCell extends DraggableListCell<Vault> {
|
||||
pathText.setTextOverrun(OverrunStyle.ELLIPSIS);
|
||||
pathText.getStyleClass().add("detail-label");
|
||||
|
||||
statusIndicator.fillProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::unlockedProperty).map(unlocked -> {
|
||||
return unlocked ? GREEN_FILL : RED_FILL;
|
||||
}));
|
||||
|
||||
statusIndicator.strokeProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::unlockedProperty).map(unlocked -> {
|
||||
return unlocked ? GREEN_STROKE : RED_STROKE;
|
||||
}));
|
||||
statusIndicator.fillProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::unlockedProperty).filter(Boolean.TRUE::equals).map(unlocked -> GREEN_FILL).orElse(RED_FILL));
|
||||
statusIndicator.strokeProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::unlockedProperty).filter(Boolean.TRUE::equals).map(unlocked -> GREEN_STROKE).orElse(RED_STROKE));
|
||||
|
||||
tooltipProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::path).map(p -> new Tooltip(p.toString())));
|
||||
contextMenuProperty().bind(EasyBind.monadic(itemProperty()).flatMap(Vault::unlockedProperty).map(unlocked -> {
|
||||
|
||||
Reference in New Issue
Block a user