com.tensegrity.gui.swing.control
Interface FileChooserCallback


public interface FileChooserCallback

The FileChooserCallback is triggered each time a File instance is required either to save or to load a file. Its getFile(int mode) method gets called and a mode identifier is passed, to describe what exactly is required to return as implementor. This mode identifier lets you decide whether to offer a FileSave- or a FileOpenDialog (if user interaction is required). The result will be the same: An instance of File should be returned.

Version:
$Id: FileChooserCallback.java,v 1.3 2004/06/03 13:59:14 GillesIachelini Exp $
Author:
GillesIachelini

Field Summary
static int FCC_MODE_LOAD
          The identifer to use when specifying the mode of the FileChooser.
static int FCC_MODE_SAVE
          The identifer to use when specifying the mode of the FileChooser.
 
Method Summary
 java.io.File getFile(java.io.FileFilter filter, int mode)
          This method gets called each time the user of this callback requires a valid file instance, either to store or to load from.
 

Field Detail

FCC_MODE_LOAD

public static final int FCC_MODE_LOAD
The identifer to use when specifying the mode of the FileChooser.

See Also:
Constant Field Values

FCC_MODE_SAVE

public static final int FCC_MODE_SAVE
The identifer to use when specifying the mode of the FileChooser.

See Also:
Constant Field Values
Method Detail

getFile

public java.io.File getFile(java.io.FileFilter filter,
                            int mode)
This method gets called each time the user of this callback requires a valid file instance, either to store or to load from. Each implementation of this method might decide whether to use user interaction or not. The only agreement is the result of this method: A valid File instance or null to indicate an operator initiated termination.

Parameters:
filter - a FileFilter to use.
mode - the mode in which this method is called. Either to return a File to load or a location to save to.
Returns:
the valid File instance to load from or save to. A null indicates, that the user (or system) has cancelled the process.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.