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

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

public class FileChooser
extends java.lang.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, java.awt.Frame pFrame, java.lang.String pTitle)
          Shows an "open" dialog.
 void saveAs(UILauncher pLauncher, java.awt.Frame pFrame, IFileHandle pFileHandle, java.lang.String pTitle)
          Shows a "Save as" dialog.
 void selectDirectory(UILauncher pLauncher, java.awt.Frame pFrame, IFileHandleReceiver pFileHandleReceiver, java.lang.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,
                   java.awt.Frame pFrame,
                   IFileHandle pFileHandle,
                   java.lang.String pTitle)
            throws java.io.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:
java.io.IOException - if file access is not possible
java.lang.SecurityException - if a security manager denies the access

open

public IFileHandle[] open(UILauncher pLauncher,
                          java.awt.Frame pFrame,
                          java.lang.String pTitle)
                   throws java.io.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:
java.io.IOException - if file access fails

selectDirectory

public void selectDirectory(UILauncher pLauncher,
                            java.awt.Frame pFrame,
                            IFileHandleReceiver pFileHandleReceiver,
                            java.lang.String pTitle)
                     throws java.io.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:
java.io.IOException - if file access is not possible
java.lang.SecurityException - if a security manager denies the access


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.