Package docking.widgets.filechooser
Class LocalFileChooserModel
- java.lang.Object
- 
- docking.widgets.filechooser.LocalFileChooserModel
 
- 
- All Implemented Interfaces:
- GhidraFileChooserModel
 
 public class LocalFileChooserModel extends java.lang.Object implements GhidraFileChooserModel A default implementation of the file chooser model that browses the local file system.
- 
- 
Constructor SummaryConstructors Constructor Description LocalFileChooserModel()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreateDirectory(java.io.File directory, java.lang.String name)Creates a directory in the specified directory with the specified name.protected java.lang.StringformatRootPathForDisplay(java.io.File root)Returns the string path of a file system root, formatted so it doesn't have a trailing backslash in the case of Windows root drive strings such as "c:\\", which becomes "c:"java.lang.StringgetDescription(java.io.File file)Returns a description for the specified file.java.io.FilegetDesktopDirectory()Probes for a "Desktop" directory under the user's home directory.protected java.lang.StringgetFastRootDescriptionString(java.io.File root)Return a description string for a file system root.java.io.FilegetHomeDirectory()Returns the home directory.javax.swing.IcongetIcon(java.io.File file)Returns an icon for the specified file.java.io.File[]getListing(java.io.File directory, java.io.FileFilter filter)Returns an array of the files that exist in the specified directory.protected java.lang.StringgetRootDescriptionString(java.io.File root)Return a description string for a root location.java.io.File[]getRoots()Returns the root drives/directories.chargetSeparator()Returns the file separator char.booleanisAbsolute(java.io.File file)Tests whether this abstract pathname is absolute.booleanisDirectory(java.io.File file)Tests whether the file denoted by this abstract pathname is a directory.booleanrenameFile(java.io.File src, java.io.File dest)Renames the src file to the dest file.voidsetListener(GhidraFileChooserListener l)Set the model listener.
 
- 
- 
- 
Method Detail- 
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
- See Also:
- GhidraFileChooserModel.getSeparator()
 
 - 
setListenerpublic void setListener(GhidraFileChooserListener l) Description copied from interface:GhidraFileChooserModelSet the model listener.- Specified by:
- setListenerin interface- GhidraFileChooserModel
- Parameters:
- l- the new model listener
- See Also:
- GhidraFileChooserModel.setListener(ghidra.util.filechooser.GhidraFileChooserListener)
 
 - 
getHomeDirectorypublic java.io.File getHomeDirectory() Description copied from interface:GhidraFileChooserModelReturns the home directory.- Specified by:
- getHomeDirectoryin interface- GhidraFileChooserModel
- Returns:
- the home directory
- See Also:
- GhidraFileChooserModel.getHomeDirectory()
 
 - 
getDesktopDirectorypublic java.io.File getDesktopDirectory() Probes for a "Desktop" directory under the user's home directory.Returns null if the desktop directory is missing. - Specified by:
- getDesktopDirectoryin interface- GhidraFileChooserModel
- Returns:
- desktop directory
- See Also:
- GhidraFileChooserModel.getDesktopDirectory()
 
 - 
getRootspublic java.io.File[] getRoots() Description copied from interface:GhidraFileChooserModelReturns the root drives/directories. On windows, "C:\", "D:\", etc. On linux, "/".- Specified by:
- getRootsin interface- GhidraFileChooserModel
- Returns:
- the root drives
- See Also:
- GhidraFileChooserModel.getRoots()
 
 - 
getFastRootDescriptionStringprotected java.lang.String getFastRootDescriptionString(java.io.File root) Return a description string for a file system root. Avoid slow calls (such asFileSystemView.getSystemDisplayName(File).Used when pre-populating the root description map with values before background threadfinishes.
 - 
getRootDescriptionStringprotected java.lang.String getRootDescriptionString(java.io.File root) Return a description string for a root location.Called from a background threadto avoid blocking the UI while waiting for slow file systems.- Parameters:
- root-
- Returns:
- string such as "Local Disk (C:)", "Network Drive (R:)"
 
 - 
formatRootPathForDisplayprotected java.lang.String formatRootPathForDisplay(java.io.File root) Returns the string path of a file system root, formatted so it doesn't have a trailing backslash in the case of Windows root drive strings such as "c:\\", which becomes "c:"
 - 
getListingpublic java.io.File[] getListing(java.io.File directory, java.io.FileFilter filter)Description copied from interface:GhidraFileChooserModelReturns an array of the files that exist in the specified directory.- Specified by:
- getListingin interface- GhidraFileChooserModel
- Parameters:
- directory- the directory
- Returns:
- an array of files
- See Also:
- GhidraFileChooserModel.getListing(java.io.File, java.io.FileFilter)
 
 - 
getIconpublic javax.swing.Icon getIcon(java.io.File file) Description 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
- See Also:
- GhidraFileChooserModel.getIcon(java.io.File)
 
 - 
getDescriptionpublic java.lang.String getDescription(java.io.File file) Description 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
- See Also:
- GhidraFileChooserModel.getDescription(java.io.File)
 
 - 
createDirectorypublic boolean createDirectory(java.io.File directory, java.lang.String name)Description 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.
- See Also:
- GhidraFileChooserModel.createDirectory(java.io.File, java.lang.String)
 
 - 
isDirectorypublic boolean isDirectory(java.io.File file) Description copied from interface:GhidraFileChooserModelTests whether the file denoted by this abstract pathname is a directory.- Specified by:
- isDirectoryin interface- GhidraFileChooserModel
- Returns:
- trueif and only if the file denoted by this abstract pathname exists and is a directory;- falseotherwise
- See Also:
- GhidraFileChooserModel.isDirectory(java.io.File)
 
 - 
isAbsolutepublic boolean isAbsolute(java.io.File file) Description 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
- Returns:
- trueif this abstract pathname is absolute,- falseotherwise
- See Also:
- GhidraFileChooserModel.isAbsolute(java.io.File)
 
 - 
renameFilepublic boolean renameFile(java.io.File src, java.io.File dest)Description copied from interface:GhidraFileChooserModelRenames the src file to the dest file.- Specified by:
- renameFilein interface- GhidraFileChooserModel
- Parameters:
- src- the file to be renamed
- dest- the new file
- Returns:
- true if the file was renamed
- See Also:
- GhidraFileChooserModel.renameFile(java.io.File, java.io.File)
 
 
- 
 
-