diff --git a/utility-db/src/main/java/com/dua3/utility/db/DbUtil.java b/utility-db/src/main/java/com/dua3/utility/db/DbUtil.java
index 5e9db532..0685127a 100644
--- a/utility-db/src/main/java/com/dua3/utility/db/DbUtil.java
+++ b/utility-db/src/main/java/com/dua3/utility/db/DbUtil.java
@@ -65,8 +65,9 @@ public final class DbUtil {
try {
// load properties
Map
*/
-public class FileInput extends CustomControl implements InputControl {
+public class FileInput extends CustomControl implements InputControl<@Nullable Path> {
private static final StringConverter PATH_CONVERTER = new PathConverter();
@@ -60,11 +60,11 @@ public Path fromString(@Nullable String s) {
}
}
- private final ObjectProperty value = new SimpleObjectProperty<>();
+ private final ObjectProperty<@Nullable Path> value = new SimpleObjectProperty<>();
private final FileDialogMode mode;
private final FileChooser.ExtensionFilter[] filters;
- private final Supplier dflt;
+ private final Supplier<@Nullable Path> dflt;
private final StringProperty error = new SimpleStringProperty("");
private final BooleanProperty valid = new SimpleBooleanProperty(true);
@@ -83,7 +83,7 @@ public FileInput(
boolean existingOnly,
Supplier dflt,
Collection filters,
- Function> validate) {
+ Function<@Nullable Path, Optional> validate) {
super(new HBox());
getStyleClass().setAll("file-input");
@@ -208,7 +208,7 @@ public static Function> defaultValidate(FileDialogMode mo
};
}
- private Path getPath() {
+ private @Nullable Path getPath() {
return value.get();
}
@@ -223,7 +223,7 @@ public void reset() {
}
@Override
- public Property valueProperty() {
+ public Property<@Nullable Path> valueProperty() {
return value;
}
diff --git a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputBuilder.java b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputBuilder.java
index 8fa8e36a..94c56691 100644
--- a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputBuilder.java
+++ b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputBuilder.java
@@ -286,7 +286,7 @@ default B comboBoxEx(
@Nullable Supplier add,
@Nullable BiPredicate, T> remove,
Function format,
- Supplier dflt,
+ Supplier<@Nullable T> dflt,
Class cls,
Collection items
) {
@@ -333,7 +333,7 @@ B comboBoxEx(
* @param items the items to choose from
* @return {@code this}
*/
- default B radioList(
+ default B radioList(
String id,
String label,
Supplier dflt,
diff --git a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGrid.java b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGrid.java
index 152dca7a..7c748a1b 100644
--- a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGrid.java
+++ b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGrid.java
@@ -17,6 +17,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -41,7 +42,7 @@ public class InputGrid extends GridPane {
private static final String MARKER_OK = "";
protected final BooleanProperty valid = new SimpleBooleanProperty(false);
- private Collection> data = null;
+ private Collection> data = Collections.emptyList();
private int columns = 1;
/**
@@ -166,12 +167,12 @@ public void reset() {
*
* @param the input's value type
*/
- static final class Meta {
+ static final class Meta {
final String id;
final Class cls;
final Supplier extends T> dflt;
final InputControl super T> control;
- final Label label;
+ final @Nullable Label label;
final Label marker = new Label();
Meta(String id, @Nullable String label, Class cls, Supplier extends T> dflt, InputControl super T> control) {
diff --git a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGridBuilder.java b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGridBuilder.java
index fd12afa3..e9c5b54c 100644
--- a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGridBuilder.java
+++ b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/InputGridBuilder.java
@@ -74,7 +74,7 @@ static class ControlWrapper implements InputControl {
private final Node node;
- private final Property value = new SimpleObjectProperty<>(null);
+ private final Property value = new SimpleObjectProperty<>();
private final BooleanProperty valid = new SimpleBooleanProperty(true);
private final ReadOnlyStringProperty error = new SimpleStringProperty("");
@@ -120,7 +120,7 @@ private InputGridBuilder doAdd(String id, @Nullable String label, Class t
@Override
public InputGridBuilder addNode(String id, @Nullable String label, Node node) {
- Meta meta = new Meta<>(id, label, Void.class, null, new ControlWrapper(node));
+ Meta meta = new Meta<>(id, label, Void.class, () -> null, new ControlWrapper(node));
Meta> prev = data.put(id, meta);
LangUtil.check(prev == null, "Input with id '" + id + "' already defined");
return this;
@@ -128,7 +128,7 @@ public InputGridBuilder addNode(String id, @Nullable String label, Node node) {
@Override
public InputGridBuilder addNode(String id, Node node) {
- Meta meta = new Meta<>(id, null, Void.class, null, new ControlWrapper(node));
+ Meta meta = new Meta<>(id, null, Void.class, () -> null, new ControlWrapper(node));
Meta> prev = data.put(id, meta);
LangUtil.check(prev == null, "Input with id '" + id + "' already defined");
return this;
diff --git a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/OptionsPane.java b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/OptionsPane.java
index 556b779b..246a8da0 100644
--- a/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/OptionsPane.java
+++ b/utility-fx-controls/src/main/java/com/dua3/utility/fx/controls/OptionsPane.java
@@ -43,9 +43,9 @@ public class OptionsPane extends GridPane implements InputControl {
*/
protected static final Logger LOG = LogManager.getLogger(OptionsPane.class);
private static final Insets INSETS = new Insets(2);
- private final InputControl.State state;
+ private final InputControl.State<@Nullable Arguments> state;
private final Supplier extends Collection