org.gnome.gtk

Interface FileChooser

Known Implementing Classes:
FileChooserButton

public interface FileChooser

Nested Class Summary

static interface
FileChooser.SELECTION_CHANGED
Event generated when the selection in this FileChooser is changed.

Method Summary

void
connect(FileChooser.SELECTION_CHANGED handler)
Hook up a callback to handle the "selection-changed" signal generated when the file or directory has been set.
String
getCurrentFolder()
Get the current folder being displayed in this FileChooser.
String
getFilename()
Get the filename currently selected by this FileChooser.
URI
getURI()
Get the URI representing the file or directory currently selected by this FileChooser.
boolean
setCurrentFolder(String directory)
Set the current directory for this FileChooser.

Method Details

connect

public void connect(FileChooser.SELECTION_CHANGED handler)
Hook up a callback to handle the "selection-changed" signal generated when the file or directory has been set.

getCurrentFolder

public String getCurrentFolder()
Returns:
The current folder, or null if if the FileChooser was unable to load the last folder that was requested of it (as would happen if calling setCurrentFolder(String) on a nonexistent directory).
Since:
4.0.2
See Also:
getFilename()

getFilename

public String getFilename()
Get the filename currently selected by this FileChooser.
Returns:
The filename, or if no file is selected then this will return null. If multiple files are selected, one of the filenames will be returned at random. If the FileChooser is in one of the folder modes, this returns the selected folder's name.

getURI

public URI getURI()
Get the URI representing the file or directory currently selected by this FileChooser.
Returns:
The selected file's URI, or if no file is selected then this will return null. If multiple files are selected, one of the filenames will be returned at random. If the FileChooser is in one of the folder modes, this returns the selected folder's URI.

setCurrentFolder

public boolean setCurrentFolder(String directory)
Set the current directory for this FileChooser. The user will be shown the full contents of that folder, plus user interface elements for navigating to other folders.
Parameters:
directory - the full path of the new current folder
Returns:
true if the folder could be changed successfully, false otherwise.
Since:
4.0.2