Interface FilePicker

All Known Subinterfaces:
FileOpenPicker, FileSavePicker
All Known Implementing Classes:
NativeFileOpenPicker, NativeFileSavePicker, WebFileOpenPicker, WebFileSavePicker

public interface FilePicker
A file picker interface for selecting and interacting with files.
Author:
Besmir Beqiri
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ObjectProperty<File>
    Defines the initial directory for the displayed file dialog.
    javafx.beans.property.StringProperty
    The initial file name for the displayed dialog.
    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.
    javafx.beans.property.StringProperty
    The title of the displayed file dialog.
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.collections.ObservableList<ExtensionFilter>
    Gets the extension filters used in the displayed file dialog.
    The initial directory for the displayed file dialog.
    The initial file name for the displayed dialog.
    javafx.scene.Node
    Returns the associated node for this file picker.
    Gets the extension filter which is currently selected in the displayed file dialog.
    Gets the title of the displayed file dialog.
    javafx.beans.property.ObjectProperty<File>
    Defines the initial directory for the displayed file dialog.
    javafx.beans.property.StringProperty
    The initial file name for the displayed dialog.
    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.
    void
    Sets the initial directory for the displayed file dialog.
    void
    Sets the initial file name for the displayed dialog.
    void
    Sets the extension filter which is currently selected in the displayed file dialog.
    void
    Sets the title of the displayed file dialog.
    javafx.beans.property.StringProperty
    The title of the displayed file dialog.
  • Property Details

    • title

      javafx.beans.property.StringProperty titleProperty
      The title of the displayed file dialog.
      See Also:
    • initialFileName

      javafx.beans.property.StringProperty initialFileNameProperty
      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.

      See Also:
    • initialDirectory

      javafx.beans.property.ObjectProperty<File> initialDirectoryProperty
      Defines the initial directory for the displayed file dialog.
      See Also:
    • selectedExtensionFilter

      javafx.beans.property.ObjectProperty<ExtensionFilter> selectedExtensionFilterProperty
      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.

      See Also:
  • Method Details

    • getNode

      javafx.scene.Node getNode()
      Returns the associated node for this file picker.
      Returns:
      the associated node for this file picker.
    • getTitle

      String getTitle()
      Gets the title of the displayed file dialog.
      Returns:
      the title string
    • setTitle

      void setTitle(String value)
      Sets the title of the displayed file dialog.
      Parameters:
      value - the title string
    • titleProperty

      javafx.beans.property.StringProperty titleProperty()
      The title of the displayed file dialog.
      Returns:
      the title property
      See Also:
    • getInitialFileName

      String getInitialFileName()
      The initial file name for the displayed dialog.
      Returns:
      the file name as a string
    • setInitialFileName

      void setInitialFileName(String value)
      Sets the initial file name for the displayed dialog.
      Parameters:
      value - the file name
    • initialFileNameProperty

      javafx.beans.property.StringProperty initialFileNameProperty()
      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

      File getInitialDirectory()
      The initial directory for the displayed file dialog.
      Returns:
      the initial directory as a File object
    • setInitialDirectory

      void setInitialDirectory(File value)
      Sets the initial directory for the displayed file dialog.
      Parameters:
      value - the initial directory as a File object
    • initialDirectoryProperty

      javafx.beans.property.ObjectProperty<File> initialDirectoryProperty()
      Defines the initial directory for the displayed file dialog.
      Returns:
      the initialDirectory property
      See Also:
    • getExtensionFilters

      javafx.collections.ObservableList<ExtensionFilter> getExtensionFilters()
      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.
      Returns:
      An observable list of the extension filters used in the dialog
    • getSelectedExtensionFilter

      ExtensionFilter getSelectedExtensionFilter()
      Gets the extension filter which is currently selected in the displayed file dialog.
      Returns:
      the selected extension filter or null if no extension
    • setSelectedExtensionFilter

      void setSelectedExtensionFilter(ExtensionFilter value)
      Sets the extension filter which is currently selected in the displayed file dialog.
      Parameters:
      value - the selected extension filter
    • selectedExtensionFilterProperty

      javafx.beans.property.ObjectProperty<ExtensionFilter> selectedExtensionFilterProperty()
      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.

      Returns:
      the selectedExtensionFilter property
      See Also: