Class WebFileSavePicker

java.lang.Object
one.jpro.platform.file.picker.WebFileSavePicker
All Implemented Interfaces:
FilePicker, FileSavePicker

public class WebFileSavePicker extends Object
Represents a 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 Details

  • Constructor Details

    • WebFileSavePicker

      public WebFileSavePicker(javafx.scene.Node node)
  • Method Details

    • getTitle

      public final String getTitle()
      Gets the value of the title property.
      Property description:
      Returns:
      the value of the title property
      See Also:
    • setTitle

      public final void setTitle(String value)
      Sets the value of the title property.
      Property description:
      Parameters:
      value - the value for the title property
      See Also:
    • titleProperty

      public final javafx.beans.property.StringProperty titleProperty()
      Description copied from interface: FilePicker
      The title of the displayed file dialog.
      Returns:
      the title property
      See Also:
    • initialFileNameProperty

      public final javafx.beans.property.StringProperty initialFileNameProperty()
      Description copied from interface: FilePicker
      The 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.

      Returns:
      the initialFileName property
      See Also:
    • getInitialDirectory

      public final File getInitialDirectory()
      Gets the value of the initialDirectory property.
      Property description:
      Returns:
      the value of the initialDirectory property
      See Also:
    • setInitialDirectory

      public final void setInitialDirectory(File value)
      Sets the value of the initialDirectory property.
      Property description:
      Parameters:
      value - the value for the initialDirectory property
      See Also:
    • initialDirectoryProperty

      public final javafx.beans.property.ObjectProperty<File> initialDirectoryProperty()
      Description copied from interface: FilePicker
      Defines the initial directory for the displayed file dialog.
      Returns:
      the initialDirectory property
      See Also:
    • getTempDirectory

      public final File getTempDirectory()
      Returns the temporary directory.
      Returns:
      the temporary directory as a File object.
    • setTempDirectory

      public final void setTempDirectory(File value)
      Sets the temporary directory.
      Parameters:
      value - the temporary directory as a File object.
    • tempDirectoryProperty

      public final javafx.beans.property.ObjectProperty<File> tempDirectoryProperty()
      Retrieves the property that represents the temporary directory where the files will be saved before offered for downloading.
      Returns:
      the tempDirectory property
      See Also:
    • getOnFileSelected

      public final Function<File,CompletableFuture<Void>> getOnFileSelected()
      Description copied from interface: FileSavePicker
      Gets the handler function that is called when the user selects a file to save. The handler accepts a File and returns a CompletableFuture<Void> indicating when the file save operation has completed.
      Specified by:
      getOnFileSelected in interface FileSavePicker
      Returns:
      the handler function for file selection, or null if none is set
    • setOnFileSelected

      public final void setOnFileSelected(Function<File,CompletableFuture<Void>> value)
      Description copied from interface: FileSavePicker
      Sets the handler function to be called when the user selects a file to save. The handler function should accept a File object and return a CompletableFuture<Void> that completes when the save operation is finished.
      Specified by:
      setOnFileSelected in interface FileSavePicker
      Parameters:
      value - the handler function to set, or null to remove any existing handler
    • onFileSelectedProperty

      public final javafx.beans.property.ObjectProperty<Function<File,CompletableFuture<Void>>> onFileSelectedProperty()
      Description copied from interface: FileSavePicker
      Returns 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 a File and returns a CompletableFuture<Void> indicating when the file save operation has completed.
      Specified by:
      onFileSelectedProperty in interface FileSavePicker
      Returns:
      the onFileSelected property
      See Also:
    • getNode

      public final javafx.scene.Node getNode()
      Description copied from interface: FilePicker
      Returns the associated node for this file picker.
      Specified by:
      getNode in interface FilePicker
      Returns:
      the associated node for this file picker.
    • getInitialFileName

      public final String getInitialFileName()
      Description copied from interface: FilePicker
      The initial file name for the displayed dialog.
      Specified by:
      getInitialFileName in interface FilePicker
      Returns:
      the file name as a string
    • setInitialFileName

      public final void setInitialFileName(String value)
      Description copied from interface: FilePicker
      Sets the initial file name for the displayed dialog.
      Specified by:
      setInitialFileName in interface FilePicker
      Parameters:
      value - the file name
    • getExtensionFilters

      public final javafx.collections.ObservableList<ExtensionFilter> getExtensionFilters()
      Description copied from interface: FilePicker
      Gets 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:
      getExtensionFilters in interface FilePicker
      Returns:
      An observable list of the extension filters used in the dialog
    • getSelectedExtensionFilter

      public final ExtensionFilter getSelectedExtensionFilter()
      Description copied from interface: FilePicker
      Gets the extension filter which is currently selected in the displayed file dialog.
      Specified by:
      getSelectedExtensionFilter in interface FilePicker
      Returns:
      the selected extension filter or null if no extension
    • setSelectedExtensionFilter

      public final void setSelectedExtensionFilter(ExtensionFilter filter)
      Description copied from interface: FilePicker
      Sets the extension filter which is currently selected in the displayed file dialog.
      Specified by:
      setSelectedExtensionFilter in interface FilePicker
      Parameters:
      filter - the selected extension filter
    • selectedExtensionFilterProperty

      public final javafx.beans.property.ObjectProperty<ExtensionFilter> selectedExtensionFilterProperty()
      Description copied from interface: FilePicker
      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.

      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:
      selectedExtensionFilterProperty in interface FilePicker
      Returns:
      the selectedExtensionFilter property
      See Also: