Package org.eclipse.ui.dialogs
Class FileSystemElement
java.lang.Object
org.eclipse.ui.dialogs.FileSystemElement
- All Implemented Interfaces:
- IAdaptable
Instances of this class represent files or file-like entities (eg.- zip file
 entries) on the local file system. They do not represent resources within the
 workbench. This distinction is made because the representation of a file
 system resource is significantly different from that of a workbench resource.
 If self represents a collection (eg.- file system directory, zip directory)
 then its icon will be the folderIcon static field. Otherwise (ie.- self
 represents a file system file) self's icon is stored in field "icon", and is
 determined by the extension of the file that self represents.
 This class is adaptable, and implements one adapter itself, namely the
 IWorkbenchAdapter adapter used for navigation and display in the workbench.
- 
Constructor SummaryConstructorsConstructorDescriptionFileSystemElement(String name, FileSystemElement parent, boolean isDirectory) Creates a newFileSystemElementand initializes it and its parent if applicable.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddChild(FileSystemElement child) Adds the passed child to this object's collection of children.<T> TgetAdapter(Class<T> adapter) Returns the adapterReturns the extension of this element's filename.getFiles()Answer the files property of this element.Returns the file system object property of this elementReturns a list of the folders that are immediate children of this folder.Return the parent of this element.booleanvoidremoveFolder(FileSystemElement child) Removes a sub-folder from this file system element.voidsetFileSystemObject(Object value) Set the file system object property of this elementvoidsetParent(FileSystemElement element) Sets the parent of this file system element.toString()For debugging purposes only.
- 
Constructor Details- 
FileSystemElementCreates a newFileSystemElementand initializes it and its parent if applicable.- Parameters:
- name- The name of the element
- parent- The parent element. May be- null
- isDirectory- if- truethis is representing a directory, otherwise it is a file.
 
 
- 
- 
Method Details- 
addChildAdds the passed child to this object's collection of children.- Parameters:
- child- FileSystemElement
 
- 
getAdapterReturns the adapter- Specified by:
- getAdapterin interface- IAdaptable
- Type Parameters:
- T- the class type
- Parameters:
- adapter- the adapter class to look up
- Returns:
- a object of the given class, or nullif this object does not have an adapter for the given class
 
- 
getFileNameExtensionReturns the extension of this element's filename.- Returns:
- The extension or an empty string if there is no extension.
 
- 
getFilesAnswer the files property of this element. Answer an empty list if the files property is null. This method should not be used to add children to the receiver. Use addChild(FileSystemElement) instead.- Returns:
- AdaptableList The list of files parented by the receiver.
 
- 
getFileSystemObjectReturns the file system object property of this element- Returns:
- the file system object
 
- 
getFoldersReturns a list of the folders that are immediate children of this folder. Answer an empty list if the folders property is null. This method should not be used to add children to the receiver. Use addChild(FileSystemElement) instead.- Returns:
- AdapatableList The list of folders parented by the receiver.
 
- 
getParentReturn the parent of this element.- Returns:
- the parent file system element, or nullif this is the root
 
- 
isDirectorypublic boolean isDirectory()- Returns:
- boolean trueif this element represents a directory, andfalseotherwise.
 
- 
removeFolderRemoves a sub-folder from this file system element.- Parameters:
- child- The child to remove.
 
- 
setFileSystemObjectSet the file system object property of this element- Parameters:
- value- the file system object
 
- 
setParentSets the parent of this file system element.- Parameters:
- element- The new parent.
 
- 
toStringFor debugging purposes only.
 
-