mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
add validation for required parameters and changed exception message
This commit is contained in:
@@ -12,6 +12,7 @@ import javafx.stage.Stage;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.IllegalFormatException;
|
||||
import java.util.Objects;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -128,10 +129,16 @@ public class SimpleDialog {
|
||||
}
|
||||
|
||||
public SimpleDialog build() {
|
||||
Objects.requireNonNull(titleKey,"SimpleDialog titleKey must be set.");
|
||||
Objects.requireNonNull(messageKey,"SimpleDialog messageKey must be set.");
|
||||
Objects.requireNonNull(descriptionKey,"SimpleDialog descriptionKey must be set.");
|
||||
Objects.requireNonNull(okButtonKey,"SimpleDialog okButtonKey must be set.");
|
||||
Objects.requireNonNull(cancelButtonKey,"SimpleDialog cancelButtonKey must be set.");
|
||||
|
||||
try {
|
||||
return new SimpleDialog(this);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to create CustomDialog.", e);
|
||||
throw new UncheckedIOException("Failed to create SimpleDialog.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
<Region VBox.vgrow="ALWAYS" minHeight="18"/>
|
||||
<ButtonBar buttonMinWidth="120" buttonOrder="+CI">
|
||||
<buttons>
|
||||
<Button fx:id="cancelButton" text="CANCEL" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#handleCancel"/>
|
||||
<Button fx:id="okButton" text="OK" ButtonBar.buttonData="FINISH" defaultButton="true" onAction="#handleOk"/>
|
||||
<Button fx:id="cancelButton" ButtonBar.buttonData="CANCEL_CLOSE" cancelButton="true" onAction="#handleCancel"/>
|
||||
<Button fx:id="okButton" ButtonBar.buttonData="FINISH" defaultButton="true" onAction="#handleOk"/>
|
||||
</buttons>
|
||||
</ButtonBar>
|
||||
</VBox>
|
||||
|
||||
Reference in New Issue
Block a user