mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 04:31:27 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user