java.lang.Object
com.dua3.utility.fx.controls.FileInputBuilder
Builder for creating instances of
FileInput with customizable options.
The builder provides methods to configure the file dialog mode, initial path,
extension filters, validation, and disabled state.-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuild()Builds aFileInputobject using the properties specified in theFileInputBuilder.disabled(ObservableValue<Boolean> disabled) Sets the 'disabled' property for the FileInput control.existingOnly(boolean flag) Sets the flag indicating whether only existing files or directories should be selectable.filter(FileChooser.ExtensionFilter... filter) Adds the specified file extension filters to the FileChooser.initialPath(@Nullable Path initialPath) Sets the initial path for the file input.initialPath(Supplier<Path> initialPath) Sets the initial path for the FileInputBuilder using the providedSupplier<Path>.Sets the validation function for the file input.
-
Methodendetails
-
disabled
Sets the 'disabled' property for the FileInput control.- Parameter:
disabled- an ObservableValue object representing the disabled state of the FileInput control- Gibt zurück:
- the current instance of FileInputBuilder with the 'disabled' property set
-
validate
Sets the validation function for the file input.- Parameter:
validate- a function that takes a Path and returns an Optional containing an error message if validation fails, or an empty Optional if validation succeeds- Gibt zurück:
- the updated FileInputBuilder instance
-
initialPath
Sets the initial path for the file input.- Parameter:
initialPath- the initial path to set, which may be null- Gibt zurück:
- an instance of FileInputBuilder with the specified initial path
-
initialPath
Sets the initial path for the FileInputBuilder using the providedSupplier<Path>.- Parameter:
initialPath- a Supplier that provides the initial Path- Gibt zurück:
- the FileInputBuilder instance with the updated initial path
-
filter
Adds the specified file extension filters to the FileChooser.- Parameter:
filter- One or more FileChooser.ExtensionFilter objects representing the file extension filters to be added.- Gibt zurück:
- The current instance of FileInputBuilder, allowing for method chaining.
-
existingOnly
Sets the flag indicating whether only existing files or directories should be selectable.- Parameter:
flag- a boolean flag; if true, only existing files or directories can be selected, otherwise new ones can also be selected- Gibt zurück:
- the current instance of FileInputBuilder for method chaining
-
build
Builds aFileInputobject using the properties specified in theFileInputBuilder.- Gibt zurück:
- a constructed
FileInputcontrol based on the current configuration.
-