org.gnome.gtk
Interface FileChooser
- FileChooserButton
public interface FileChooser
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.
|
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()
Get the current folder being displayed in this FileChooser. Note that
this is not the same as the currently-selected folder if the
FileChooser is in
SELECT_FOLDER
mode. To get the currently-selected folder in that mode, you can use
getURI()
instead.
- 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).
getFilename
public String getFilename()
Get the filename currently selected by this FileChooser.
- 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.
- 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.
directory
- the full path of the new current folder
true
if the folder could be changed
successfully, false
otherwise.
|  java-gnome |