org.ejtools.util
Class FileTools

java.lang.Object
  |
  +--org.ejtools.util.FileTools
Direct Known Subclasses:
CSVFileTools, PNGFileTools, WorkspaceFileTools

public class FileTools
extends java.lang.Object

Helper class to make easy the file selection. Handles the overwrite in case of save actions.

Version:
$Revision: 1.2 $
Author:
Laurent Etiemble

Nested Class Summary
protected static class FileTools.SimpleFileFilter
          An helper class that simplifies the creation of a FileFilter.
 
Constructor Summary
protected FileTools()
          Default constructor
 
Method Summary
static java.io.File selectFile(java.lang.String title, java.lang.String approveText, int type, FileTools.SimpleFileFilter filter)
          Select a file through a JFileChooser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTools

protected FileTools()
Default constructor

Method Detail

selectFile

public static java.io.File selectFile(java.lang.String title,
                                      java.lang.String approveText,
                                      int type,
                                      FileTools.SimpleFileFilter filter)
Select a file through a JFileChooser.

Parameters:
title - The title for the JFileChooser
approveText - The text that appears on the approve button
type - The type of operation
filter - The FileFilter to use
Returns:
The selected file otherwise null
See Also:
JFileChooser.OPEN_DIALOG, JFileChooser.SAVE_DIALOG


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.