Class DirectoryChooserOptions
- java.lang.Object
-
- net.sf.jguiraffe.gui.dlg.AbstractDialogOptions<File,DirectoryChooserOptions>
-
- net.sf.jguiraffe.gui.dlg.filechooser.DirectoryChooserOptions
-
public class DirectoryChooserOptions extends AbstractDialogOptions<File,DirectoryChooserOptions>
A class for defining the options of a directory chooser dialog.
Instances of this class can be passed to a file chooser service to configure the behavior of a directory chooser dialog. 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 DirectoryChooserOptions(DialogResultCallback<File,?> resultCallback)
Creates a new instance ofDirectoryChooserOptions
and sets the callback to be notified with the dialog result.DirectoryChooserOptions(DialogResultCallback<File,D> resultCallback, D data)
Creates a new instance ofDirectoryChooserOptions
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 File
getInitialDirectory()
Returns the initial directory for the directory chooser dialog.protected DirectoryChooserOptions
getSelf()
Returns a self reference to this object.DirectoryChooserOptions
setInitialDirectory(File directory)
Allows setting the initial directory for the directory chooser dialog.-
Methods inherited from class net.sf.jguiraffe.gui.dlg.AbstractDialogOptions
getCancelInvoker, getResultCallback, getTitle, getTitleResource, resolveTitle, setCanceledCallback, setCanceledCallback, setTitle, setTitleResource
-
-
-
-
Constructor Detail
-
DirectoryChooserOptions
public DirectoryChooserOptions(DialogResultCallback<File,D> resultCallback, D data)
Creates a new instance ofDirectoryChooserOptions
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
-
DirectoryChooserOptions
public DirectoryChooserOptions(DialogResultCallback<File,?> resultCallback)
Creates a new instance ofDirectoryChooserOptions
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
-
setInitialDirectory
public DirectoryChooserOptions setInitialDirectory(File directory)
Allows setting the initial directory for the directory chooser dialog.- Parameters:
directory
- the initial directory- Returns:
- this object
-
getInitialDirectory
public File getInitialDirectory()
Returns the initial directory for the directory chooser dialog. Result can be null if no such directory has been set.- Returns:
- the initial directory
-
getSelf
protected DirectoryChooserOptions 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,DirectoryChooserOptions>
- Returns:
- a self reference
-
-