org.gnu.gtk

Class FileSelection

public class FileSelection extends Dialog

The FileSelection widget lists all the files and directories in the current working directory and enables the user to select one of the file names. There are a number of navigation controls that enable the user to browse through the entire file system. There also are buttons that create directories, delete files, and rename files.
Constructor Summary
FileSelection(String title)
construct a new FileSelection dialog.
FileSelection(Handle handle)
Construct a FileSelection using a handle to a native resource.
Method Summary
voidcomplete(String pattern)
Will attempt to match pattern to a valid filename or subdirectory in the current directory.
ButtongetCancelButton()
Return the Cancel Button widget for this dialog.
WidgetgetDirList()
Return the directory list for this widget
WidgetgetFileList()
Returns the the file list for this widget
StringgetFilename()
Returns the selected filename.
static FileSelectiongetFileSelection(Handle handle)
Internal static factory method to be used by Java-Gnome only.
ButtongetHelpButton()
Return the Help Button widget for this dialog.
ButtongetOKButton()
Return the OK Button widget for this Dialog.
WidgetgetSelectionEntry()
Returns the selection entry
String[]getSelections()
Retrieves the list of file selections the user has made in the dialog box.
booleangetSelectMultiple()
Determines whether or not the user is allowed to select multiple files in the file list.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidhideFileopButtons()
Hides the file operation buttons that normally appear at the top of the dialog.
voidsetFilename(String filename)
Sets the default path for the file requestor.
voidsetSelectMultiple(boolean selectMultiple)
Sets whether the user is allowed to select multiple files in the file list.
voidshowFileopButtons()
Shows the file operation buttons, if they have previously been hidden.

Constructor Detail

FileSelection

public FileSelection(String title)
construct a new FileSelection dialog.

Parameters: title The string that is displayed in the title bar of the dialog.

FileSelection

public FileSelection(Handle handle)
Construct a FileSelection using a handle to a native resource.

Method Detail

complete

public void complete(String pattern)
Will attempt to match pattern to a valid filename or subdirectory in the current directory. If a match can be made the matched filename will appear in the text entry field in the file selection dialog. If a partial match can be made the "Files" list will contain those file names which have been partially matched and the "Directories" list will list those directories which have been partially matched.

Parameters: pattern The pattern to use for matching.

getCancelButton

public Button getCancelButton()
Return the Cancel Button widget for this dialog.

Returns: The Cancel Button.

getDirList

public Widget getDirList()
Return the directory list for this widget

Returns: The Directory List

getFileList

public Widget getFileList()
Returns the the file list for this widget

Returns: The File List

getFilename

public String getFilename()
Returns the selected filename.

Returns: The file that is selected in the dialog.

getFileSelection

public static FileSelection getFileSelection(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getHelpButton

public Button getHelpButton()
Return the Help Button widget for this dialog.

Returns: The Help Button.

getOKButton

public Button getOKButton()
Return the OK Button widget for this Dialog.

Returns: The OK Button.

getSelectionEntry

public Widget getSelectionEntry()
Returns the selection entry

Returns: selection entry

getSelections

public String[] getSelections()
Retrieves the list of file selections the user has made in the dialog box. This function is intended for use when the user can select multiple files in the file list.

getSelectMultiple

public boolean getSelectMultiple()
Determines whether or not the user is allowed to select multiple files in the file list.

See Also: FileSelection

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

hideFileopButtons

public void hideFileopButtons()
Hides the file operation buttons that normally appear at the top of the dialog.

setFilename

public void setFilename(String filename)
Sets the default path for the file requestor. If filename includes a directory path the requestor will open with that path set as its current working directory.

Parameters: filename The default path for the widget.

setSelectMultiple

public void setSelectMultiple(boolean selectMultiple)
Sets whether the user is allowed to select multiple files in the file list. Use FileSelection to get the list of selected files.

showFileopButtons

public void showFileopButtons()
Shows the file operation buttons, if they have previously been hidden. The rest of the widgets in the dialog will be resized accordingly.