com.bigzip.plugin.support.ui
Class DirectoryChooser

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--com.bigzip.plugin.support.ui.DirectoryChooser
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class DirectoryChooser
extends javax.swing.JDialog

The DirectoryChooser is used to allow the user to select a directory in the file system. The dialog allows the user to navigate the directory hierarchies in all the available file systems and to create new directories.

An accessory component can be added to the dialog box to allow the user to chooser task-specific options along with a directory.

The directory chooser can be used and customized in a number of ways:

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  javax.swing.JComponent accessory
          This is the accessory component to be displayed in the chooser.
static int APPROVE_OPTION
          Return value if approve (yes, ok) is chosen.
protected  javax.swing.JButton approveButton
          This is the approve button.
protected  int approved
          The approval status of the chooser.
static int CANCEL_OPTION
          Return value if cancel is chosen.
protected  javax.swing.JButton cancelButton
          This is the cancel button.
protected  com.bigzip.plugin.support.ui.DirectoryChooserPane directoryChooserPane
          This is the directory chooser pane.
static int ERROR_OPTION
          Return value if an error occured.
protected  javax.swing.JButton goHomeButton
          This is the 'Go Home' button.
protected  boolean ignoreDirectoryChangeNotifications
          Indicates if directory change notifications should be ignored.
protected  boolean ignoreFieldChangeNotifications
          Indicates if change notifications in the path field should be ignored.
protected  javax.swing.JButton newDirectoryButton
          This is the 'New Directory' button.
protected  java.awt.Frame parent
          This is the parent of the chooser.
protected  javax.swing.JTextField pathField
          This is field where the user may directly enter a path.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DirectoryChooser()
          Creates a new directory chooser with user's working directory selected by default.
DirectoryChooser(java.io.File initialPath)
          Creates a new directory chooser with directory refered to by the given path selected by default.
DirectoryChooser(java.awt.Frame parent, java.io.File initialPath)
          Creates a new directory chooser with directory refered to by the given path selected by default.
DirectoryChooser(java.awt.Frame parent, java.lang.String initialPath)
          Creates a new directory chooser with directory refered to by the given path selected by default.
DirectoryChooser(java.lang.String initialPath)
          Creates a new directory chooser with directory refered to by the given path selected by default.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Registers a property change listener that will receive notification when a directory is chosen in the directory chooser.
protected  javax.swing.JButton createDefaultApproveButton()
          Creates a button with the label "Select", mnemonic 's', and which calls the doApproveAction method when clicked.
protected  javax.swing.JButton createDefaultCancelButton()
          Creates a button with the label "Cancel", mnemonic 'c', and which calls the doCancelAction method when clicked.
protected  javax.swing.JButton createDefaultGoHomeButton()
          Creates a button with the default 'go home' icon for the current look'n'feel, mnemonic 'c', and which calls the doGoHomeAction method when clicked.
protected  javax.swing.JButton createDefaultNewDirectoryButton()
          Creates a button with the default 'new folder' icon for the current look'n'feel, mnemonic 'n', and which calls the doNewDirectoryAction method when clicked.
protected  void doApproveAction()
          Performs the standard response to the approve button being clicked.
protected  void doCancelAction()
          Performs the standard response to the cancel button being clicked.
protected  void doCreateNewDirectoryAction()
          Performs the standard response to the new directory button being clicked.
protected  void doGoHomeAction()
          Performs the standard response to the go home button being clicked.
static java.io.File findFirstExistingParent(java.io.File path)
          Finds the first parent directory in the directory hierarchy that exists for a given path.
 javax.swing.JComponent getAccessory()
          Retrieves the accessory component displayed in the directory chooser.
 int getApproveButtonMnemonic()
          Retrieves the the approve button's mnemonic.
 java.lang.String getApproveButtonText()
          Retrieves the text that appears in the approve button.
 java.lang.String getApproveButtonToolTipText()
          Retrieves the approve button's tooltip text.
 java.io.File getCurrentDirectory()
          Retrieves the currently selected directory.
 boolean isApproved()
          Tests if the directory chooser was approved.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Unregisters a listener from being notified when the user chooses a directory.
 void setAccessory(javax.swing.JComponent accessory)
          Sets the accessory to display in the directory chooser.
 void setApproveButtonMnemonic(char mnemonic)
          Sets the approve button's mnemonic.
 void setApproveButtonText(java.lang.String label)
          Sets the text that appears in the approve button.
 void setApproveButtonToolTipText(java.lang.String text)
          Sets the approve button's tooltip text.
 void setCurrentDirectory(java.io.File path)
          Sets the currently selected directory.
 int showDialog()
          Shows the directory chooser to the user.
static java.io.File showDirectoryChooser(java.awt.Frame parent)
          Shows the standard directory chooser with the user's home directory initially selected.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.io.File initialPath)
          Shows the standard directory chooser.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.io.File initialPath, javax.swing.JComponent accessory)
          Shows the standard directory chooser with a custom accessory.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.io.File initialPath, java.lang.String dialogTitle)
          Shows the standard directory chooser with a custom dialog box title.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.io.File initialPath, java.lang.String dialogTitle, javax.swing.JComponent accessory)
          Shows the standard directory chooser with a custom dialog box title and accessory.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.io.File initialPath, java.lang.String dialogTitle, javax.swing.JComponent accessory, java.lang.String approveButtonText, char approveButtonMnemonic, java.lang.String approveButtonToolTipText)
          Shows the standard directory chooser with a custom dialog box title, accessory and approve button.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.lang.String initialPath)
          Shows the standard directory chooser.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.lang.String initialPath, javax.swing.JComponent accessory)
          Shows the standard directory chooser with a custom accessory.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.lang.String initialPath, java.lang.String dialogTitle)
          Shows the standard directory chooser with a custom dialog box title.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.lang.String initialPath, java.lang.String dialogTitle, javax.swing.JComponent accessory)
          Shows the standard directory chooser with a custom dialog box title and accessory.
static java.io.File showDirectoryChooser(java.awt.Frame parent, java.lang.String initialPath, java.lang.String dialogTitle, javax.swing.JComponent accessory, java.lang.String approveButtonText, char approveButtonMnemonic, java.lang.String approveButtonToolTipText)
          Shows the standard directory chooser with a custom dialog box title, accessory and approve button.
protected  void updateDirectoryChooser()
          Synchronizes the selection in the directory chooser pane with the path field.
protected  void updatePathField()
          Synchronizes the paht field with the selection in the directory chooser.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

APPROVE_OPTION

public static final int APPROVE_OPTION
Return value if approve (yes, ok) is chosen.

CANCEL_OPTION

public static final int CANCEL_OPTION
Return value if cancel is chosen.

ERROR_OPTION

public static final int ERROR_OPTION
Return value if an error occured.

approved

protected int approved
The approval status of the chooser. If the user uses the approve button to dismiss the dialog, this value should be set to APPROVE_OPTION. If the user dismisses the dialog in any other way, this value should be set to CANCEL_OPTION. If an error occurs while initializing the chooser, this value should be set to ERROR_OPTION.

accessory

protected javax.swing.JComponent accessory
This is the accessory component to be displayed in the chooser.

approveButton

protected javax.swing.JButton approveButton
This is the approve button. It can be customized by over-riding the createDefaultApproveButton method.

cancelButton

protected javax.swing.JButton cancelButton
This is the cancel button. It can be customized by over-riding the createDefaultCancelButton method.

directoryChooserPane

protected com.bigzip.plugin.support.ui.DirectoryChooserPane directoryChooserPane
This is the directory chooser pane. The directory chooser pane displays the available file systems, and the directory tree for the selected file system.

goHomeButton

protected javax.swing.JButton goHomeButton
This is the 'Go Home' button. It will make the selected directory the user's home directory. It can be customized by over-riding the createDefaultGoHomeButton method.

newDirectoryButton

protected javax.swing.JButton newDirectoryButton
This is the 'New Directory' button. It will allow the user to create a new directory under the currently selected directory. It can be customized by over-riding the createDefaultNewDirectory button method.

parent

protected java.awt.Frame parent
This is the parent of the chooser. It can be null.

pathField

protected javax.swing.JTextField pathField
This is field where the user may directly enter a path. The field is update to reflect the currently selected directory if the user chooses a directory in the directory chooser pane.

ignoreDirectoryChangeNotifications

protected boolean ignoreDirectoryChangeNotifications
Indicates if directory change notifications should be ignored. When a directory is chosen in the directory chooser pane, it generates a directory change event so that the path field can be updated. When this instance variable is true, that change notification should be ignored because a new directory has been chosen in the directory chooser pane in response to a change in the path field. This is to stop an endless loop of change notifications between the directory chooser pane and the path field.

ignoreFieldChangeNotifications

protected boolean ignoreFieldChangeNotifications
Indicates if change notifications in the path field should be ignored. When a path is entered into the path field, a change notification is generated for the path field so that the directory chooser pan can be updated to reflect the changes in the path field. When this instance variable is true, that change notification should be ignored because the path field has been updated in responce to a directory being selected in the directory chooser pane. This is to stop an endless loop of change notifications between the directory chooser pane and the path field.
Constructor Detail

DirectoryChooser

public DirectoryChooser()
Creates a new directory chooser with user's working directory selected by default.

DirectoryChooser

public DirectoryChooser(java.lang.String initialPath)
Creates a new directory chooser with directory refered to by the given path selected by default.

DirectoryChooser

public DirectoryChooser(java.awt.Frame parent,
                        java.lang.String initialPath)
Creates a new directory chooser with directory refered to by the given path selected by default. The chooser will be set as a child dialog of the specified parent.

DirectoryChooser

public DirectoryChooser(java.io.File initialPath)
Creates a new directory chooser with directory refered to by the given path selected by default.

DirectoryChooser

public DirectoryChooser(java.awt.Frame parent,
                        java.io.File initialPath)
Creates a new directory chooser with directory refered to by the given path selected by default. The chooser will be set as a child dialog of the specified parent.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a property change listener that will receive notification when a directory is chosen in the directory chooser.
Overrides:
addPropertyChangeListener in class java.awt.Component
Parameters:
listener - The listener to notify.

createDefaultApproveButton

protected javax.swing.JButton createDefaultApproveButton()
Creates a button with the label "Select", mnemonic 's', and which calls the doApproveAction method when clicked.

createDefaultCancelButton

protected javax.swing.JButton createDefaultCancelButton()
Creates a button with the label "Cancel", mnemonic 'c', and which calls the doCancelAction method when clicked.

createDefaultGoHomeButton

protected javax.swing.JButton createDefaultGoHomeButton()
Creates a button with the default 'go home' icon for the current look'n'feel, mnemonic 'c', and which calls the doGoHomeAction method when clicked.

createDefaultNewDirectoryButton

protected javax.swing.JButton createDefaultNewDirectoryButton()
Creates a button with the default 'new folder' icon for the current look'n'feel, mnemonic 'n', and which calls the doNewDirectoryAction method when clicked.

doApproveAction

protected void doApproveAction()
Performs the standard response to the approve button being clicked. The path in the path field is checked to see if it exists. If it does not exist, that user is asked if it should be created. If the user disapproves of the creation, the user is returned to the directory chooser to choose another directory; otherwise, the directory is created. If an error occurs while creating the directory, the user is informed and then returned to the directory chooser. If the directory exists or was successfully created, the approved instance variable is set to APPROVE_OPTION and the chooser is disposed of.

doCancelAction

protected void doCancelAction()
Performs the standard response to the cancel button being clicked. The approved instance variable is set to CANCEL_OPTION and the chooser is disposed of.

doCreateNewDirectoryAction

protected void doCreateNewDirectoryAction()
Performs the standard response to the new directory button being clicked. This user is prompted to enter the name of the new directory. If the user approves the prompt, the directory is created. If an error occurs while creating the directory, the user is alerted to the error. In any case, the user is returned to the directory chooser.

doGoHomeAction

protected void doGoHomeAction()
Performs the standard response to the go home button being clicked. The currently selected directory is set to the user's home directory.

findFirstExistingParent

public static java.io.File findFirstExistingParent(java.io.File path)
Finds the first parent directory in the directory hierarchy that exists for a given path. Starting with the leaf directory, each directory is checked if it exists, if it doesn't its parent directory is checked until a directory is found to exist or the root of the file system is reached.
Parameters:
path - The path of the directory to start searching from.
Returns:
The first directory found to exist or null if no directory were found.

getAccessory

public javax.swing.JComponent getAccessory()
Retrieves the accessory component displayed in the directory chooser. The component will reflect the state of its contained components when the directory chooser was dismissed.

getApproveButtonText

public java.lang.String getApproveButtonText()
Retrieves the text that appears in the approve button.

getApproveButtonMnemonic

public int getApproveButtonMnemonic()
Retrieves the the approve button's mnemonic.

getApproveButtonToolTipText

public java.lang.String getApproveButtonToolTipText()
Retrieves the approve button's tooltip text.

getCurrentDirectory

public java.io.File getCurrentDirectory()
Retrieves the currently selected directory.

isApproved

public boolean isApproved()
Tests if the directory chooser was approved.
Returns:
true if the user used the approve button to dismiss the chooser, false otherwise.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters a listener from being notified when the user chooses a directory.
Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
listener - The listener to unregister.

setAccessory

public void setAccessory(javax.swing.JComponent accessory)
Sets the accessory to display in the directory chooser.

setApproveButtonText

public void setApproveButtonText(java.lang.String label)
Sets the text that appears in the approve button.

setApproveButtonMnemonic

public void setApproveButtonMnemonic(char mnemonic)
Sets the approve button's mnemonic.

setApproveButtonToolTipText

public void setApproveButtonToolTipText(java.lang.String text)
Sets the approve button's tooltip text.

setCurrentDirectory

public void setCurrentDirectory(java.io.File path)
Sets the currently selected directory. Both the directory chooser pane and the path field will be updated to reflect the change.
Throws:
java.lang.IllegalArgumentException - The path given doesn't not refer to a directory.

showDialog

public int showDialog()
Shows the directory chooser to the user. The standard chooser is constructed, it is then packed and positioned relative to its parent and finally shown.
Returns:
APPROVE_OPTION if the approve button clicked, CANCEL_OPTION if the chooser was cancelled in some way, or ERROR_OPTION if an error occurred while initialising the chooser.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent)
Shows the standard directory chooser with the user's home directory initially selected.
Parameters:
parent - The parent frame of the chooser.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.lang.String initialPath)
Shows the standard directory chooser.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.lang.String initialPath,
                                                javax.swing.JComponent accessory)
Shows the standard directory chooser with a custom accessory.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
accessory - The accessory component to be displayed in the chooser.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.lang.String initialPath,
                                                java.lang.String dialogTitle)
Shows the standard directory chooser with a custom dialog box title.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.lang.String initialPath,
                                                java.lang.String dialogTitle,
                                                javax.swing.JComponent accessory)
Shows the standard directory chooser with a custom dialog box title and accessory.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
accessory - The accessory component to be displayed in the chooser.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.lang.String initialPath,
                                                java.lang.String dialogTitle,
                                                javax.swing.JComponent accessory,
                                                java.lang.String approveButtonText,
                                                char approveButtonMnemonic,
                                                java.lang.String approveButtonToolTipText)
Shows the standard directory chooser with a custom dialog box title, accessory and approve button.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
accessory - The accessory component to be displayed in the chooser.
approveButtonText - The text to appear in the approve button.
approveButtonMnemonic - The approve button's mnemonic.
approveBuutonToolTipText - The approve button's tooltip text.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.io.File initialPath)
Shows the standard directory chooser.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.io.File initialPath,
                                                javax.swing.JComponent accessory)
Shows the standard directory chooser with a custom accessory.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
accessory - The accessory component to be displayed in the chooser.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.io.File initialPath,
                                                java.lang.String dialogTitle)
Shows the standard directory chooser with a custom dialog box title.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.io.File initialPath,
                                                java.lang.String dialogTitle,
                                                javax.swing.JComponent accessory)
Shows the standard directory chooser with a custom dialog box title and accessory.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
accessory - The accessory component to be displayed in the chooser.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

showDirectoryChooser

public static java.io.File showDirectoryChooser(java.awt.Frame parent,
                                                java.io.File initialPath,
                                                java.lang.String dialogTitle,
                                                javax.swing.JComponent accessory,
                                                java.lang.String approveButtonText,
                                                char approveButtonMnemonic,
                                                java.lang.String approveButtonToolTipText)
Shows the standard directory chooser with a custom dialog box title, accessory and approve button.
Parameters:
parent - The parent frame of the chooser.
initalPath - The directory initially selected.
dialogTitle - The string to appear as the directory chooser's title.
accessory - The accessory component to be displayed in the chooser.
approveButtonText - The text to appear in the approve button.
approveButtonMnemonic - The approve button's mnemonic.
approveBuutonToolTipText - The approve button's tooltip text.
Returns:
The directory choosen by the user or null if the chooser was cancelled.

updateDirectoryChooser

protected void updateDirectoryChooser()
Synchronizes the selection in the directory chooser pane with the path field.

updatePathField

protected void updatePathField()
Synchronizes the paht field with the selection in the directory chooser.