org.fuin.utils4swing.dialogs
Class DirectorySelector

java.lang.Object
  extended by org.fuin.utils4swing.dialogs.DirectorySelector

public class DirectorySelector
extends java.lang.Object

Helper class for selecting a directory. Can used from a non-EDT thread.


Constructor Summary
DirectorySelector(java.lang.String title, java.lang.String directory, DirectorySelectorListener listener)
          Constructor with title and start directory.
 
Method Summary
protected  void cancel()
          The user canceled the dialog.
protected  void close()
          Close the frame and free all resources.
static void main(java.lang.String[] args)
          Starts the selector for a test.
protected  void ok()
          The dialog was successfully finished.
static java.lang.String selectDirectory(java.lang.String title, java.lang.String directory)
          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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectorySelector

public DirectorySelector(java.lang.String title,
                         java.lang.String directory,
                         DirectorySelectorListener listener)
Constructor with title and start directory.

Parameters:
title - Title of the frame and panel.
directory - Start directory.
listener - Listener to inform about the result.
Method Detail

show

public final void show()
Show the monitor dialog.If called outside the EDT this method will switch to the UI thread using SwingUtilities.invokeAndWait(Runnable).


close

protected final void close()
Close the frame and free all resources. After calling "close" the monitor object cannot be used again!If called outside the EDT this method will switch to the UI thread using SwingUtilities.invokeAndWait(Runnable).


cancel

protected final void cancel()
The user canceled the dialog.


ok

protected final void ok()
The dialog was successfully finished.


selectDirectory

public static java.lang.String selectDirectory(java.lang.String title,
                                               java.lang.String directory)
                                        throws CanceledException
Blocks the current thread and waits for the result of the selection dialog.

Parameters:
title - Title to display for the dialog.
directory - Initial directory.
Returns:
Selected directory.
Throws:
CanceledException - The user canceled the dialog.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Starts the selector for a test.

Parameters:
args - Not used.
Throws:
java.io.IOException - Error creating the canonical path for the current directory.


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.