mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-28 07:30:19 +00:00
renamed property
This commit is contained in:
@@ -16,7 +16,8 @@ public class SimpleDialogController implements FxController {
|
||||
private final String cancelButtonText;
|
||||
private final Runnable okAction;
|
||||
private final Runnable cancelAction;
|
||||
private final BooleanProperty dismissed = new SimpleBooleanProperty();
|
||||
private final BooleanProperty cancelButtonVisible = new SimpleBooleanProperty(true);
|
||||
|
||||
|
||||
public SimpleDialogController(String message, String description, FontAwesome5Icon icon, String okButtonText, String cancelButtonText, Runnable okAction, Runnable cancelAction) {
|
||||
this.message = message;
|
||||
@@ -26,12 +27,18 @@ public class SimpleDialogController implements FxController {
|
||||
this.cancelButtonText = cancelButtonText;
|
||||
this.okAction = okAction;
|
||||
this.cancelAction = cancelAction;
|
||||
this.cancelButtonVisible.set(cancelButtonText != null && !cancelButtonText.isEmpty());
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
dismissed.set(cancelButtonText == null || cancelButtonText.isEmpty());
|
||||
|
||||
public BooleanProperty cancelButtonVisibleProperty() {
|
||||
return cancelButtonVisible;
|
||||
}
|
||||
|
||||
public boolean isCancelButtonVisible(){
|
||||
return cancelButtonVisible.get();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
@@ -52,11 +59,6 @@ public class SimpleDialogController implements FxController {
|
||||
return cancelButtonText;
|
||||
}
|
||||
|
||||
@FXML
|
||||
public boolean getDismissed() {
|
||||
return dismissed.get();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleOk() {
|
||||
if (okAction != null) {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<Region VBox.vgrow="ALWAYS" minHeight="18"/>
|
||||
<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
|
||||
<buttons>
|
||||
<Button text="${controller.cancelButtonText}" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#handleCancel" visible="${controller.dismissed}" managed="${controller.dismissed}"/>
|
||||
<Button text="${controller.cancelButtonText}" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#handleCancel" visible="${controller.cancelButtonVisible}" managed="${controller.cancelButtonVisible}"/>
|
||||
<Button text="${controller.okButtonText}" ButtonBar.buttonData="FINISH" defaultButton="true" onAction="#handleOk"/>
|
||||
</buttons>
|
||||
</ButtonBar>
|
||||
|
||||
Reference in New Issue
Block a user