public class DirectorySelector extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectorySelector.Result
Immutable directory selection result.
|
| Constructor and Description |
|---|
DirectorySelector(String title,
String directory,
boolean showIncludeSubdirs,
DirectorySelectorListener listener)
Constructor with title and start directory.
|
DirectorySelector(String title,
String directory,
DirectorySelectorListener listener)
Constructor with title and start directory.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancel()
The user canceled the dialog.
|
protected void |
close()
Close the frame and free all resources.
|
static void |
main(String[] args)
Starts the selector for a test.
|
protected void |
ok()
The dialog was successfully finished.
|
static DirectorySelector.Result |
selectDirectory(String title,
String directory)
Blocks the current thread and waits for the result of the selection
dialog.
|
static DirectorySelector.Result |
selectDirectory(String title,
String directory,
boolean showIncludeSubdirs)
Blocks the current thread and waits for the result of the selection
dialog.
|
void |
show()
Show the monitor dialog.If called outside the EDT this method will switch
to the UI thread using
SwingUtilities.invokeAndWait(Runnable). |
public DirectorySelector(String title, String directory, DirectorySelectorListener listener)
title - Title of the frame and panel.directory - Start directory.listener - Listener to inform about the result.public DirectorySelector(String title, String directory, boolean showIncludeSubdirs, DirectorySelectorListener listener)
title - Title of the frame and panel.directory - Start directory.showIncludeSubdirs - If the checkbox "include subdirectories" should be visible
true else false.listener - Listener to inform about the result.public final void show()
SwingUtilities.invokeAndWait(Runnable).protected final void close()
SwingUtilities.invokeAndWait(Runnable).protected final void cancel()
protected final void ok()
public static DirectorySelector.Result selectDirectory(String title, String directory) throws CanceledException
title - Title to display for the dialog.directory - Initial directory.CanceledException - The user canceled the dialog.public static DirectorySelector.Result selectDirectory(String title, String directory, boolean showIncludeSubdirs) throws CanceledException
title - Title to display for the dialog.directory - Initial directory.showIncludeSubdirs - If the checkbox "include subdirectories" should be visible
true else false.CanceledException - The user canceled the dialog.public static void main(String[] args) throws IOException
args - Not used.IOException - Error creating the canonical path for the current directory.Copyright © 2013 Future Invent Informationsmanagement GmbH, Hamburg (Germany). All Rights Reserved.