com.jniwrapper.win32.ui.dialogs
Class SelectFolderDialog

java.lang.Object
  extended by com.jniwrapper.win32.ui.dialogs.SelectFolderDialog

public class SelectFolderDialog
extends java.lang.Object

SelectFolderDialog is a wrapper to the native BrowseForFolder dialog.

It allows to set an initial folder, selected folder, etc.


Nested Class Summary
 class SelectFolderDialog.SelectFolderDialogOptions
           
 
Constructor Summary
SelectFolderDialog()
          Creates a new dialog.
SelectFolderDialog(java.lang.String title)
          Creates a new dialog with a specified title.
SelectFolderDialog(java.lang.String rootFolder, java.lang.String title)
          Creates a new dialog with a specified root folder and title.
SelectFolderDialog(java.awt.Window owner)
          Creates a new dialog with a specified owner window.
SelectFolderDialog(java.awt.Window owner, java.io.File rootFolder)
          Creates a new dialog with a specified owner window and root folder.
SelectFolderDialog(java.awt.Window owner, java.lang.String title)
          Creates a new dialog with a specified owner window and title.
SelectFolderDialog(java.awt.Window owner, java.lang.String rootFolder, java.lang.String title)
          Creates a new dialog with a specified owner window, root folder and title.
SelectFolderDialog(Wnd owner)
          Creates a new dialog with a specified owner window.
SelectFolderDialog(Wnd owner, java.io.File rootFolder)
          Creates a new dialog with a specified owner window and root folder.
SelectFolderDialog(Wnd owner, java.io.File rootFolder, java.lang.String title)
          Creates a new dialog with a specified owner window, root folder and title.
SelectFolderDialog(Wnd owner, java.lang.String title)
          Creates a new dialog with a specified owner window and title.
 
Method Summary
static SelectFolderDialog createBrowseForComputersDialog()
          Factory method that creates a dialog box customized to browse computers.
static SelectFolderDialog createBrowseForPrintersDialog()
          Factory method that creates a dialog box customized to browse printers.
 boolean execute()
          Opens SelectFolderDialog.
 java.lang.String getFolder()
           
 SelectFolderDialog.SelectFolderDialogOptions getOptions()
           
 java.awt.Window getOwner()
          Returns owner window
 Wnd getOwnerWnd()
          Returns owner window handle.
 ShellFolder getStartFolder()
          Location of the root folder from which to start browsing.
 java.lang.String getTitle()
          Returns dialog title, if any.
protected  void reset()
           
 void setFolder(java.lang.String folder)
          Full path to the folder selected by the user.
 void setOwner(java.awt.Window owner)
          Sets new owner window.
 void setOwnerWnd(Wnd ownerWnd)
          Sets new owner window handle.
 void setStartFolder(ShellFolder startFolder)
          Location of the root folder from which to start browsing.
 void setTitle(java.lang.String title)
          Sets the dialog title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectFolderDialog

public SelectFolderDialog()
Creates a new dialog.


SelectFolderDialog

public SelectFolderDialog(java.lang.String title)
Creates a new dialog with a specified title.

Parameters:
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(java.lang.String rootFolder,
                          java.lang.String title)
Creates a new dialog with a specified root folder and title.

Parameters:
rootFolder - folder that dialog will open;
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(java.awt.Window owner)
Creates a new dialog with a specified owner window.

Parameters:
owner - owner window;

SelectFolderDialog

public SelectFolderDialog(java.awt.Window owner,
                          java.io.File rootFolder)
Creates a new dialog with a specified owner window and root folder.

Parameters:
owner - owner's window handle;
rootFolder - folder that dialog will open;

SelectFolderDialog

public SelectFolderDialog(java.awt.Window owner,
                          java.lang.String title)
Creates a new dialog with a specified owner window and title.

Parameters:
owner - owners window;
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(java.awt.Window owner,
                          java.lang.String rootFolder,
                          java.lang.String title)
Creates a new dialog with a specified owner window, root folder and title.

Parameters:
owner - owner window;
rootFolder - folder that dialog will open;
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(Wnd owner,
                          java.io.File rootFolder,
                          java.lang.String title)
Creates a new dialog with a specified owner window, root folder and title.

Parameters:
owner - owner's window handle;
rootFolder - folder that dialog will open;
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(Wnd owner,
                          java.io.File rootFolder)
Creates a new dialog with a specified owner window and root folder.

Parameters:
owner - owner's window handle;
rootFolder - folder that dialog will open;

SelectFolderDialog

public SelectFolderDialog(Wnd owner,
                          java.lang.String title)
Creates a new dialog with a specified owner window and title.

Parameters:
owner - owner's window handle;
title - dialog's title

SelectFolderDialog

public SelectFolderDialog(Wnd owner)
Creates a new dialog with a specified owner window.

Parameters:
owner - owner's window handle;
Method Detail

reset

protected void reset()

getTitle

public java.lang.String getTitle()
Returns dialog title, if any.

Returns:
dialog title

setTitle

public void setTitle(java.lang.String title)
Sets the dialog title.

Parameters:
title - dialog title

getFolder

public java.lang.String getFolder()
Returns:
selected folder.

setFolder

public void setFolder(java.lang.String folder)
Full path to the folder selected by the user.

Parameters:
folder -

getOwner

public java.awt.Window getOwner()
Returns owner window

Returns:
window owner window

setOwner

public void setOwner(java.awt.Window owner)
Sets new owner window.

Parameters:
owner - owner window

setOwnerWnd

public void setOwnerWnd(Wnd ownerWnd)
Sets new owner window handle.

Parameters:
ownerWnd - owner window handle

getOwnerWnd

public Wnd getOwnerWnd()
Returns owner window handle.

Returns:
owner window handle

getOptions

public SelectFolderDialog.SelectFolderDialogOptions getOptions()
Returns:
FlagSet contains dialog options.

getStartFolder

public ShellFolder getStartFolder()
Location of the root folder from which to start browsing. Only a specified folder and any folders beneath it in the namespace hierarchy appear in the dialog box.

Returns:
start location folder id

setStartFolder

public void setStartFolder(ShellFolder startFolder)
Location of the root folder from which to start browsing. Only a specified folder and any folders beneath it in the namespace hierarchy appear in the dialog box.

Parameters:
startFolder - is folder id

execute

public boolean execute()
Opens SelectFolderDialog.

Returns:
true, if the folder is selected.

createBrowseForComputersDialog

public static SelectFolderDialog createBrowseForComputersDialog()
Factory method that creates a dialog box customized to browse computers.


createBrowseForPrintersDialog

public static SelectFolderDialog createBrowseForPrintersDialog()
Factory method that creates a dialog box customized to browse printers.