Przeglądaj źródła

cancelButtonVisible BooleanProperty to boolean

Jan-Peter Klein 1 miesiąc temu
rodzic
commit
ede1c72595

+ 3 - 9
src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java

@@ -3,8 +3,6 @@ package org.cryptomator.ui.dialogs;
 import org.cryptomator.ui.common.FxController;
 import org.cryptomator.ui.controls.FontAwesome5Icon;
 
-import javafx.beans.property.BooleanProperty;
-import javafx.beans.property.SimpleBooleanProperty;
 import javafx.fxml.FXML;
 
 public class SimpleDialogController implements FxController {
@@ -16,7 +14,7 @@ public class SimpleDialogController implements FxController {
 	private final String cancelButtonText;
 	private final Runnable okAction;
 	private final Runnable cancelAction;
-	private final BooleanProperty cancelButtonVisible = new SimpleBooleanProperty(true);
+	private final boolean cancelButtonVisible;
 
 	public SimpleDialogController(String message, String description, FontAwesome5Icon icon, String okButtonText, String cancelButtonText, Runnable okAction, Runnable cancelAction) {
 		this.message = message;
@@ -26,15 +24,11 @@ public class SimpleDialogController implements FxController {
 		this.cancelButtonText = cancelButtonText;
 		this.okAction = okAction;
 		this.cancelAction = cancelAction;
-		this.cancelButtonVisible.set(cancelButtonText != null && !cancelButtonText.isEmpty());
-	}
-
-	public BooleanProperty cancelButtonVisibleProperty() {
-		return cancelButtonVisible;
+		this.cancelButtonVisible = cancelButtonText != null && !cancelButtonText.isEmpty();
 	}
 
 	public boolean isCancelButtonVisible() {
-		return cancelButtonVisible.get();
+		return cancelButtonVisible;
 	}
 
 	public String getMessage() {