- All Implemented Interfaces:
MultipleFileSelector,FileOpenPicker,FilePicker
FileOpenPicker implementation for JavaFX desktop/mobile
applications. This class specializes for selecting and opening files from
the native file system.- Author:
- Besmir Beqiri, Indrit 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.javafx.beans.property.ObjectProperty<Consumer<List<? extends FileSource>>> Defines the handler to be called when the user selects files.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<javafx.scene.control.SelectionMode> Defines the selection mode.final javafx.beans.property.StringPropertyThe title of the displayed file dialog.Properties inherited from interface one.jpro.platform.file.picker.FilePicker
selectedExtensionFilter -
Constructor Summary
ConstructorsConstructorDescriptionNativeFileOpenPicker(javafx.scene.Node node) Initializes a new instance associated with the specified node. -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.collections.ObservableList<ExtensionFilter> Gets the extension filters used in the displayed file dialog.final FileGets the value of theinitialDirectoryproperty.final StringThe initial file name for the displayed dialog.final javafx.scene.NodegetNode()Returns the associated node for this file picker.final Consumer<List<? extends FileSource>> Gets the handler to be called when the user selects files.final ExtensionFilterGets the extension filter which is currently selected in the displayed file dialog.final javafx.scene.control.SelectionModeReturns the selection mode.final StringgetTitle()Gets the value of thetitleproperty.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.javafx.beans.property.ObjectProperty<Consumer<List<? extends FileSource>>> Defines the handler to be called when the user selects files.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<javafx.scene.control.SelectionMode> Defines the selection mode.final voidsetInitialDirectory(File value) Sets the value of theinitialDirectoryproperty.final voidsetInitialFileName(String value) Sets the initial file name for the displayed dialog.final voidsetOnFilesSelected(Consumer<List<? extends FileSource>> value) Sets the handler to be called when the user selects files.final voidSets the extension filter which is currently selected in the displayed file dialog.final voidsetSelectionMode(javafx.scene.control.SelectionMode value) Sets the selection mode.final voidSets the value of thetitleproperty.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, getInitialFileName, getNode, getSelectedExtensionFilter, selectedExtensionFilterProperty, setInitialFileName, setSelectedExtensionFilter
-
Property Details
-
title
public final javafx.beans.property.StringProperty titleProperty- Returns:
- the
titleproperty - See Also:
-
initialFileName
public final javafx.beans.property.StringProperty initialFileNameProperty- Returns:
- the
initialFileNameproperty - See Also:
-
initialDirectory
- Returns:
- the
initialDirectoryproperty - See Also:
-
selectionMode
public final javafx.beans.property.ObjectProperty<javafx.scene.control.SelectionMode> selectionModeProperty- Returns:
- the
selectionModeproperty - See Also:
-
onFilesSelected
public javafx.beans.property.ObjectProperty<Consumer<List<? extends FileSource>>> onFilesSelectedProperty- Specified by:
onFilesSelectedPropertyin interfaceMultipleFileSelector- Returns:
- the
onFilesSelectedproperty - See Also:
-
selectedExtensionFilter
- Specified by:
selectedExtensionFilterPropertyin interfaceFilePicker- Returns:
- the
selectedExtensionFilterproperty - See Also:
-
-
Constructor Details
-
NativeFileOpenPicker
public NativeFileOpenPicker(javafx.scene.Node node) Initializes a new instance associated with the specified node.- Parameters:
node- The node associated with this file picker.
-
-
Method Details
-
getTitle
Gets the value of thetitleproperty.- Property description:
- Returns:
- the value of the
titleproperty - See Also:
-
setTitle
Sets the value of thetitleproperty.- Property description:
- Parameters:
value- the value for thetitleproperty- See Also:
-
titleProperty
public final javafx.beans.property.StringProperty titleProperty()Description copied from interface:FilePickerThe title of the displayed file dialog.- Returns:
- the
titleproperty - See Also:
-
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.
- Returns:
- the
initialFileNameproperty - See Also:
-
getInitialDirectory
Gets the value of theinitialDirectoryproperty.- Property description:
- Returns:
- the value of the
initialDirectoryproperty - See Also:
-
setInitialDirectory
Sets the value of theinitialDirectoryproperty.- Property description:
- Parameters:
value- the value for theinitialDirectoryproperty- See Also:
-
initialDirectoryProperty
Description copied from interface:FilePickerDefines the initial directory for the displayed file dialog.- Returns:
- the
initialDirectoryproperty - See Also:
-
selectionModeProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.control.SelectionMode> selectionModeProperty()Description copied from interface:MultipleFileSelectorDefines the selection mode. The selection mode determines how the file dialog allows the user to select files.- Returns:
- the
selectionModeproperty - See Also:
-
getSelectionMode
public final javafx.scene.control.SelectionMode getSelectionMode()Description copied from interface:MultipleFileSelectorReturns the selection mode.The default value is
SelectionMode.SINGLE.- Specified by:
getSelectionModein interfaceMultipleFileSelector- Returns:
- the selection mode of the file dialog
-
setSelectionMode
public final void setSelectionMode(javafx.scene.control.SelectionMode value) Description copied from interface:MultipleFileSelectorSets the selection mode.- Specified by:
setSelectionModein interfaceMultipleFileSelector- Parameters:
value- The selection mode to be set. This should be one of the values defined in the SelectionMode enumeration. Possible values areSelectionMode.SINGLEorSelectionMode.MULTIPLE.
-
getOnFilesSelected
Description copied from interface:MultipleFileSelectorGets the handler to be called when the user selects files.- Specified by:
getOnFilesSelectedin interfaceMultipleFileSelector- Returns:
- the event handler or
null.
-
setOnFilesSelected
Description copied from interface:MultipleFileSelectorSets the handler to be called when the user selects files.- Specified by:
setOnFilesSelectedin interfaceMultipleFileSelector- Parameters:
value- the event handler ornull.
-
onFilesSelectedProperty
public javafx.beans.property.ObjectProperty<Consumer<List<? extends FileSource>>> onFilesSelectedProperty()Description copied from interface:MultipleFileSelectorDefines the handler to be called when the user selects files. The handler returns the selected files ornullif no file has been selected.- Specified by:
onFilesSelectedPropertyin interfaceMultipleFileSelector- Returns:
- the
onFilesSelectedproperty - 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.
-
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
-
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:
-