com.jaxfront.core.util.io
Class FileSelector

java.lang.Object
  extended by com.jaxfront.core.util.io.FileSelector
All Implemented Interfaces:
FileChooseAction

public class FileSelector
extends java.lang.Object
implements FileChooseAction

This is a helper class to open and save files through a graphical dialog.


Field Summary
 int _action
           
 java.io.File[] _selection
           
 int _selectionMode
           
 
Constructor Summary
FileSelector(java.lang.String title)
           
FileSelector(java.lang.String title, int selectionMode)
           
 
Method Summary
 void addFileFilter(FileFilter filter)
           
 void addFileFilter(java.lang.String suffix, java.lang.String description, boolean acceptsDirectories)
           
 java.awt.Color getBackgroundColor()
           
 javax.swing.filechooser.FileFilter[] getFileFilter()
           
 java.io.File getSelectedFile()
           
 java.io.File[] getSelectedFiles()
           
 java.net.URL getSelectedURL()
           
 java.net.URL[] getSelectedURLs()
           
 void handleSelection(javax.swing.JFileChooser chooser, int takenAction)
          Defines what to do with the JFileChooser and the user raised action
 boolean hasSelectionChanged()
           
 void removeFileFilter(FileFilter filter)
           
 void setBackgroundColor(java.awt.Color color)
           
 void setCurrentFileFilter(FileFilter filter)
           
 void setCurrentFileFilter(java.lang.String suffix, java.lang.String description, boolean acceptsDirectories)
           
 void setRootDir(java.io.File rootDir)
           
 void setRootDir(java.lang.String rootDir)
           
 void showOpenDialog(java.awt.Component comp)
           
 void showSaveDialog(java.awt.Component comp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_action

public int _action

_selection

public java.io.File[] _selection

_selectionMode

public int _selectionMode
Constructor Detail

FileSelector

public FileSelector(java.lang.String title)

FileSelector

public FileSelector(java.lang.String title,
                    int selectionMode)
Method Detail

addFileFilter

public void addFileFilter(FileFilter filter)

addFileFilter

public void addFileFilter(java.lang.String suffix,
                          java.lang.String description,
                          boolean acceptsDirectories)

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns:
Returns the _required.

getFileFilter

public javax.swing.filechooser.FileFilter[] getFileFilter()

getSelectedFile

public java.io.File getSelectedFile()

getSelectedFiles

public java.io.File[] getSelectedFiles()

getSelectedURL

public java.net.URL getSelectedURL()

getSelectedURLs

public java.net.URL[] getSelectedURLs()

handleSelection

public void handleSelection(javax.swing.JFileChooser chooser,
                            int takenAction)
Description copied from interface: FileChooseAction
Defines what to do with the JFileChooser and the user raised action

Specified by:
handleSelection in interface FileChooseAction
See Also:
FileChooseAction.handleSelection(javax.swing.JFileChooser, int)

hasSelectionChanged

public boolean hasSelectionChanged()

removeFileFilter

public void removeFileFilter(FileFilter filter)

setBackgroundColor

public void setBackgroundColor(java.awt.Color color)
Parameters:
_required - The _required to set.

setCurrentFileFilter

public void setCurrentFileFilter(FileFilter filter)

setCurrentFileFilter

public void setCurrentFileFilter(java.lang.String suffix,
                                 java.lang.String description,
                                 boolean acceptsDirectories)

setRootDir

public void setRootDir(java.io.File rootDir)

setRootDir

public void setRootDir(java.lang.String rootDir)

showOpenDialog

public void showOpenDialog(java.awt.Component comp)

showSaveDialog

public void showSaveDialog(java.awt.Component comp)