- All Implemented Interfaces:
FilePicker,FileSavePicker
FileSavePicker implementation for JavaFX applications
running on the web via JPro server. This class specializes for downloading
a file and save it in the native file system.- Author:
- Besmir Beqiri
-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ObjectProperty<File> Defines the initial directory for the displayed file dialog.final javafx.beans.property.StringPropertyThe initial file name for the displayed dialog.final javafx.beans.property.ObjectProperty<Function<File, CompletableFuture<Void>>> Returns the property representing the handler function that is called when the user selects a file.final javafx.beans.property.ObjectProperty<ExtensionFilter> This property is used to pre-select the extension filter for the next displayed dialog and to read the user-selected extension filter from the dismissed dialog.final javafx.beans.property.ObjectProperty<File> Retrieves the property that represents the temporary directory where the files will be saved before offered for downloading.final javafx.beans.property.StringPropertyThe title of the displayed file dialog.Properties inherited from interface one.jpro.platform.file.picker.FilePicker
initialDirectory, initialFileName, selectedExtensionFilter, title -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.collections.ObservableList<ExtensionFilter> Gets the extension filters used in the displayed file dialog.final FileThe initial directory for the displayed file dialog.final StringThe initial file name for the displayed dialog.final javafx.scene.NodegetNode()Returns the associated node for this file picker.final Function<File, CompletableFuture<Void>> Gets the handler function that is called when the user selects a file to save.final ExtensionFilterGets the extension filter which is currently selected in the displayed file dialog.final FileReturns the temporary directory.final StringgetTitle()Gets the title of the displayed file dialog.final javafx.beans.property.ObjectProperty<File> Defines the initial directory for the displayed file dialog.final javafx.beans.property.StringPropertyThe initial file name for the displayed dialog.final javafx.beans.property.ObjectProperty<Function<File, CompletableFuture<Void>>> Returns the property representing the handler function that is called when the user selects a file.final javafx.beans.property.ObjectProperty<ExtensionFilter> This property is used to pre-select the extension filter for the next displayed dialog and to read the user-selected extension filter from the dismissed dialog.final voidsetInitialDirectory(File value) Sets the initial directory for the displayed file dialog.final voidsetInitialFileName(String value) Sets the initial file name for the displayed dialog.final voidsetOnFileSelected(Function<File, CompletableFuture<Void>> value) Sets the handler function to be called when the user selects a file to save.final voidSets the extension filter which is currently selected in the displayed file dialog.final voidsetTempDirectory(File value) Sets the temporary directory.final voidSets the title of the displayed file dialog.final javafx.beans.property.ObjectProperty<File> Retrieves the property that represents the temporary directory where the files will be saved before offered for downloading.final javafx.beans.property.StringPropertyThe title of the displayed file dialog.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.jpro.platform.file.picker.FilePicker
getExtensionFilters, getInitialDirectory, getInitialFileName, getNode, getSelectedExtensionFilter, getTitle, initialDirectoryProperty, initialFileNameProperty, selectedExtensionFilterProperty, setInitialDirectory, setInitialFileName, setSelectedExtensionFilter, setTitle, titleProperty
-
Property Details
-
tempDirectory
Retrieves the property that represents the temporary directory where the files will be saved before offered for downloading.- See Also:
-
onFileSelected
public final javafx.beans.property.ObjectProperty<Function<File,CompletableFuture<Void>>> onFileSelectedProperty- Specified by:
onFileSelectedPropertyin interfaceFileSavePicker- Returns:
- the property containing the handler function for file selection
- See Also:
-
initialFileName
public final javafx.beans.property.StringProperty initialFileNameProperty- Specified by:
initialFileNamePropertyin interfaceFilePicker- Returns:
- the
initialFileNameproperty - See Also:
-
initialDirectory
- Specified by:
initialDirectoryPropertyin interfaceFilePicker- Returns:
- the
initialDirectoryproperty - See Also:
-
title
public final javafx.beans.property.StringProperty titleProperty- Specified by:
titlePropertyin interfaceFilePicker- Returns:
- the
titleproperty - See Also:
-
selectedExtensionFilter
- Specified by:
selectedExtensionFilterPropertyin interfaceFilePicker- Returns:
- the
selectedExtensionFilterproperty - See Also:
-
-
Constructor Details
-
WebFileSavePicker
public WebFileSavePicker(javafx.scene.Node node)
-
-
Method Details
-
getTempDirectory
Returns the temporary directory.- Returns:
- the temporary directory as a File object.
-
setTempDirectory
Sets the temporary directory.- Parameters:
value- the temporary directory as a File object.
-
tempDirectoryProperty
Retrieves the property that represents the temporary directory where the files will be saved before offered for downloading.- Returns:
- the
tempDirectoryproperty - See Also:
-
getOnFileSelected
Description copied from interface:FileSavePickerGets the handler function that is called when the user selects a file to save. The handler accepts aFileand returns aCompletableFuture<Void> indicating when the file save operation has completed.- Specified by:
getOnFileSelectedin interfaceFileSavePicker- Returns:
- the handler function for file selection, or
nullif none is set
-
setOnFileSelected
Description copied from interface:FileSavePickerSets the handler function to be called when the user selects a file to save. The handler function should accept aFileobject and return aCompletableFuture<Void> that completes when the save operation is finished.- Specified by:
setOnFileSelectedin interfaceFileSavePicker- Parameters:
value- the handler function to set, ornullto remove any existing handler
-
onFileSelectedProperty
public final javafx.beans.property.ObjectProperty<Function<File,CompletableFuture<Void>>> onFileSelectedProperty()Description copied from interface:FileSavePickerReturns the property representing the handler function that is called when the user selects a file. This property allows for observing changes to the handler and for binding. The handler function accepts aFileand returns aCompletableFuture<Void> indicating when the file save operation has completed.- Specified by:
onFileSelectedPropertyin interfaceFileSavePicker- Returns:
- the
onFileSelectedproperty - See Also:
-
getNode
public final javafx.scene.Node getNode()Description copied from interface:FilePickerReturns the associated node for this file picker.- Specified by:
getNodein interfaceFilePicker- Returns:
- the associated node for this file picker.
-
initialFileNameProperty
public final javafx.beans.property.StringProperty initialFileNameProperty()Description copied from interface:FilePickerThe initial file name for the displayed dialog.This property is used mostly in the displayed file save dialogs as the initial file name for the file being saved. If set for a file open dialog it will have any impact on the displayed dialog only if the corresponding platform provides support for such property in its file open dialogs.
- Specified by:
initialFileNamePropertyin interfaceFilePicker- Returns:
- the
initialFileNameproperty - See Also:
-
getInitialFileName
Description copied from interface:FilePickerThe initial file name for the displayed dialog.- Specified by:
getInitialFileNamein interfaceFilePicker- Returns:
- the file name as a string
-
setInitialFileName
Description copied from interface:FilePickerSets the initial file name for the displayed dialog.- Specified by:
setInitialFileNamein interfaceFilePicker- Parameters:
value- the file name
-
initialDirectoryProperty
Description copied from interface:FilePickerDefines the initial directory for the displayed file dialog.- Specified by:
initialDirectoryPropertyin interfaceFilePicker- Returns:
- the
initialDirectoryproperty - See Also:
-
getInitialDirectory
Description copied from interface:FilePickerThe initial directory for the displayed file dialog.- Specified by:
getInitialDirectoryin interfaceFilePicker- Returns:
- the initial directory as a
Fileobject
-
setInitialDirectory
Description copied from interface:FilePickerSets the initial directory for the displayed file dialog.- Specified by:
setInitialDirectoryin interfaceFilePicker- Parameters:
value- the initial directory as aFileobject
-
getTitle
Description copied from interface:FilePickerGets the title of the displayed file dialog.- Specified by:
getTitlein interfaceFilePicker- Returns:
- the title string
-
setTitle
Description copied from interface:FilePickerSets the title of the displayed file dialog.- Specified by:
setTitlein interfaceFilePicker- Parameters:
value- the title string
-
titleProperty
public final javafx.beans.property.StringProperty titleProperty()Description copied from interface:FilePickerThe title of the displayed file dialog.- Specified by:
titlePropertyin interfaceFilePicker- Returns:
- the
titleproperty - See Also:
-
getExtensionFilters
Description copied from interface:FilePickerGets the extension filters used in the displayed file dialog. Only one extension filter from the list is active at any time in the displayed dialog and only files which correspond to this extension filter are shown. The first extension filter from the list is activated when the dialog is invoked. Then the user can switch the active extension filter to any other extension filter from the list and in this way control the set of displayed files.- Specified by:
getExtensionFiltersin interfaceFilePicker- Returns:
- An observable list of the extension filters used in the dialog
-
getSelectedExtensionFilter
Description copied from interface:FilePickerGets the extension filter which is currently selected in the displayed file dialog.- Specified by:
getSelectedExtensionFilterin interfaceFilePicker- Returns:
- the selected extension filter or
nullif no extension
-
setSelectedExtensionFilter
Description copied from interface:FilePickerSets the extension filter which is currently selected in the displayed file dialog.- Specified by:
setSelectedExtensionFilterin interfaceFilePicker- Parameters:
filter- the selected extension filter
-
selectedExtensionFilterProperty
public final javafx.beans.property.ObjectProperty<ExtensionFilter> selectedExtensionFilterProperty()Description copied from interface:FilePickerThis property is used to pre-select the extension filter for the next displayed dialog and to read the user-selected extension filter from the dismissed dialog.When the file dialog is shown, the selectedExtensionFilter will be checked. If the value of selectedExtensionFilter is null or is not contained in the list of extension filters, then the first extension filter in the list of extension filters will be selected instead. Otherwise, the specified selectedExtensionFilter will be activated.
After the dialog is dismissed the value of this property is updated to match the user-selected extension filter from the dialog.
- Specified by:
selectedExtensionFilterPropertyin interfaceFilePicker- Returns:
- the
selectedExtensionFilterproperty - See Also:
-