Package docking.widgets.filechooser
Class LocalFileChooserModel
java.lang.Object
docking.widgets.filechooser.LocalFileChooserModel
- All Implemented Interfaces:
- GhidraFileChooserModel
A default implementation of the file chooser model that browses the local file system.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancreateDirectory(File directory, String name) Creates a directory in the specified directory with the specified name.getDescription(File file) Returns a description for the specified file.Returns the user's desktop directory, as defined by their operating system and/or their windowing environment, or null if there is no desktop directory.Returns the user's downloads directory, as defined by their operating system and/or their windowing environment, or null if there is no downloads directory.Returns the home directory.Returns an icon for the specified file.getListing(File directory, FileFilter filter) Returns an array of the files that exist in the specified directory.getRoots(boolean forceUpdate) Returns a list of the root drives/directories.charReturns the file separator char.booleanisAbsolute(File file) Tests whether this abstract pathname is absolute.booleanisDirectory(File file) Tests whether the file denoted by this abstract pathname is a directory.booleanrenameFile(File src, File dest) Renames the src file to the destination file.voidsetModelUpdateCallback(Callback callback) Set the model update callback.
- 
Constructor Details- 
LocalFileChooserModelpublic LocalFileChooserModel()
 
- 
- 
Method Details- 
getSeparatorpublic char getSeparator()Description copied from interface:GhidraFileChooserModelReturns the file separator char. On windows, '\' On linux, '/'.- Specified by:
- getSeparatorin interface- GhidraFileChooserModel
- Returns:
- the file separator char
 
- 
setModelUpdateCallbackDescription copied from interface:GhidraFileChooserModelSet the model update callback.- Specified by:
- setModelUpdateCallbackin interface- GhidraFileChooserModel
- Parameters:
- callback- the new model update callback handler
 
- 
getHomeDirectoryDescription copied from interface:GhidraFileChooserModelReturns the home directory.- Specified by:
- getHomeDirectoryin interface- GhidraFileChooserModel
- Returns:
- the home directory
 
- 
getDesktopDirectoryDescription copied from interface:GhidraFileChooserModelReturns the user's desktop directory, as defined by their operating system and/or their windowing environment, or null if there is no desktop directory.Example: "/home/the_user/Desktop" or "c:/Users/the_user/Desktop" - Specified by:
- getDesktopDirectoryin interface- GhidraFileChooserModel
- Returns:
- desktop directory
 
- 
getDownloadsDirectoryDescription copied from interface:GhidraFileChooserModelReturns the user's downloads directory, as defined by their operating system and/or their windowing environment, or null if there is no downloads directory.Example: "/home/the_user/Downloads" or "c:/Users/the_user/Downloads" - Specified by:
- getDownloadsDirectoryin interface- GhidraFileChooserModel
- Returns:
- downloads directory
 
- 
getRootsDescription copied from interface:GhidraFileChooserModelReturns a list of the root drives/directories.On windows, "C:\", "D:\", etc. On linux, "/". - Specified by:
- getRootsin interface- GhidraFileChooserModel
- Parameters:
- forceUpdate- if true, request a fresh listing, if false allow a cached result
- Returns:
- the root drives
 
- 
getListingDescription copied from interface:GhidraFileChooserModelReturns an array of the files that exist in the specified directory.- Specified by:
- getListingin interface- GhidraFileChooserModel
- Parameters:
- directory- the directory
- filter- the file filter; may be null
- Returns:
- list of files
 
- 
getIconDescription copied from interface:GhidraFileChooserModelReturns an icon for the specified file.- Specified by:
- getIconin interface- GhidraFileChooserModel
- Parameters:
- file- the file
- Returns:
- an icon for the specified file
 
- 
getDescriptionDescription copied from interface:GhidraFileChooserModelReturns a description for the specified file.- Specified by:
- getDescriptionin interface- GhidraFileChooserModel
- Parameters:
- file- the file
- Returns:
- a description for the specified file
 
- 
createDirectoryDescription copied from interface:GhidraFileChooserModelCreates a directory in the specified directory with the specified name.- Specified by:
- createDirectoryin interface- GhidraFileChooserModel
- Parameters:
- directory- the directory in which to create the new directory
- name- the name of the directory
- Returns:
- true if the new directory was create.
 
- 
isDirectoryDescription copied from interface:GhidraFileChooserModelTests whether the file denoted by this abstract pathname is a directory.- Specified by:
- isDirectoryin interface- GhidraFileChooserModel
- Parameters:
- file- the file
- Returns:
- trueif and only if the file denoted by this abstract pathname exists and is a directory;- falseotherwise
 
- 
isAbsoluteDescription copied from interface:GhidraFileChooserModelTests whether this abstract pathname is absolute. The definition of absolute pathname is system dependent. On UNIX systems, a pathname is absolute if its prefix is"/". On Microsoft Windows systems, a pathname is absolute if its prefix is a drive specifier followed by"\\", or if its prefix is"\\".- Specified by:
- isAbsolutein interface- GhidraFileChooserModel
- Parameters:
- file- the file
- Returns:
- trueif this abstract pathname is absolute,- falseotherwise
 
- 
renameFileDescription copied from interface:GhidraFileChooserModelRenames the src file to the destination file.- Specified by:
- renameFilein interface- GhidraFileChooserModel
- Parameters:
- src- the file to be renamed
- dest- the new file
- Returns:
- true if the file was renamed
 
 
-