com.sibvisions.rad.ui.swing.impl
Class FileChooser

java.lang.Object
  extended by com.sibvisions.rad.ui.swing.impl.FileChooser

public class FileChooser
extends Object

The FileChooser encapsulates the access to AWT or Swing File chooser. It stores the last used directory/file and reuses the last selection for a new selection.


Constructor Summary
FileChooser()
           
 
Method Summary
 IFileHandle[] open(UILauncher pLauncher, Frame pFrame, String pTitle)
          Shows an "open" dialog.
 void saveAs(UILauncher pLauncher, Frame pFrame, IFileHandle pFileHandle, String pTitle)
          Shows a "Save as" dialog.
 void selectDirectory(UILauncher pLauncher, Frame pFrame, IFileHandleReceiver pFileHandleReceiver, String pTitle)
          Shows an "open directory" dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileChooser

public FileChooser()
Method Detail

saveAs

public void saveAs(UILauncher pLauncher,
                   Frame pFrame,
                   IFileHandle pFileHandle,
                   String pTitle)
            throws IOException
Shows a "Save as" dialog. If the parameter FileChooser.native is true, an AWT FileDialog will be used, otherwise a JFileChooser.

Parameters:
pLauncher - the UI launcher
pFrame - the parent frame
pFileHandle - the file handle
pTitle - the dialog title
Throws:
IOException - if file access is not possible
SecurityException - if a security manager denies the access

open

public IFileHandle[] open(UILauncher pLauncher,
                          Frame pFrame,
                          String pTitle)
                   throws IOException
Shows an "open" dialog. If the parameter FileChooser.native is true, an AWT FileDialog will be used, otherwise a JFileChooser.

Parameters:
pLauncher - the UI launcher
pFrame - the parent frame
pTitle - the dialog title
Returns:
the opened file handles.
Throws:
IOException - if file access fails

selectDirectory

public void selectDirectory(UILauncher pLauncher,
                            Frame pFrame,
                            IFileHandleReceiver pFileHandleReceiver,
                            String pTitle)
                     throws IOException
Shows an "open directory" dialog. If the parameter FileChooser.native is true, an AWT FileDialog will be used, otherwise a JFileChooser. On Windows OS' a JFileChooser will be used because FileDialog does not support directory selection on Windows.

Parameters:
pLauncher - the UI launcher
pFrame - the parent frame
pFileHandleReceiver - the filehandle receiver for selected directory
pTitle - the dialog title
Throws:
IOException - if file access is not possible
SecurityException - if a security manager denies the access


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.