Class FileChooserOptions
- java.lang.Object
-
- net.sf.jguiraffe.gui.dlg.AbstractDialogOptions<T,S>
-
- net.sf.jguiraffe.gui.dlg.filechooser.AbstractFileChooserOptions<File,FileChooserOptions>
-
- net.sf.jguiraffe.gui.dlg.filechooser.FileChooserOptions
-
public class FileChooserOptions extends AbstractFileChooserOptions<File,FileChooserOptions>
A class for defining the options of a file chooser dialog.
Instances of this class can be passed to a file chooser service to configure the behavior of a dialog for selecting a file to be loaded or saved. A directory or a file can already be preselected. It is further possible to define filters for specific file types (based on file extensions). The class offers a fluent API to set the single properties.
Implementation note: Instances are not thread-safe.
- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor Description FileChooserOptions(DialogResultCallback<File,?> resultCallback)
Creates a new instance ofFileChooserOptions
and sets the callback to be notified with the dialog result.FileChooserOptions(DialogResultCallback<File,D> resultCallback, D data)
Creates a new instance ofFileChooserOptions
and sets the callback to be notified with the dialog result and an additional data object to be passed to the callback.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileChooserOptions
getSelf()
Returns a self reference to this object.-
Methods inherited from class net.sf.jguiraffe.gui.dlg.filechooser.AbstractFileChooserOptions
getCurrentFile, getCurrentFilter, getCurrentFilterIndex, getFilters, getInitialDirectory, setCurrentFile, setCurrentFilterIndex, setFilters, setFilters, setInitialDirectory
-
Methods inherited from class net.sf.jguiraffe.gui.dlg.AbstractDialogOptions
getCancelInvoker, getResultCallback, getTitle, getTitleResource, resolveTitle, setCanceledCallback, setCanceledCallback, setTitle, setTitleResource
-
-
-
-
Constructor Detail
-
FileChooserOptions
public FileChooserOptions(DialogResultCallback<File,D> resultCallback, D data)
Creates a new instance ofFileChooserOptions
and sets the callback to be notified with the dialog result and an additional data object to be passed to the callback.- Type Parameters:
D
- the type of the data object- Parameters:
resultCallback
- the result callbackdata
- the data object for the callback- Throws:
IllegalArgumentException
- if the result callback is null
-
FileChooserOptions
public FileChooserOptions(DialogResultCallback<File,?> resultCallback)
Creates a new instance ofFileChooserOptions
and sets the callback to be notified with the dialog result.- Parameters:
resultCallback
- the result callback- Throws:
IllegalArgumentException
- if the result callback is null
-
-
Method Detail
-
getSelf
protected FileChooserOptions getSelf()
Description copied from class:AbstractDialogOptions
Returns a self reference to this object. This is used to support method chaining when setting multiple properties.- Specified by:
getSelf
in classAbstractDialogOptions<File,FileChooserOptions>
- Returns:
- a self reference
-
-