de.cau.cs.kieler.core.ui.wizards
Class ExtendedFileSystemElement

java.lang.Object
  extended by org.eclipse.ui.dialogs.FileSystemElement
      extended by de.cau.cs.kieler.core.ui.wizards.ExtendedFileSystemElement
All Implemented Interfaces:
IAdaptable

public class ExtendedFileSystemElement
extends FileSystemElement

A FileSystemElement representing Files and carrying extended states. Most importantly, this element tracks whether it has already been visited or not. "Visited" in this context means that someone has already added all subdirectories and subfolders to it. This class is used by FileSystemResourcesPage. TODO Document the input element stuff.

Rating yellow
2010-03-14 reviewed by haf, msp, pkl

Constructor Summary
ExtendedFileSystemElement(File file, boolean inputElement)
          Constructs a new instance.
ExtendedFileSystemElement(File file, FileSystemElement parent)
          Constructs a new instance.
 
Method Summary
 File getFile()
          Returns the file this object represents.
 boolean isInputElement()
          Returns whether or not this element was flagged as being used as a viewer's input element.
 boolean isVisited()
          Checks if the element has already been visited.
 void setFileSystemObject(Object value)
          
 void visit()
          Indicates that this object has now been visited.
 
Methods inherited from class org.eclipse.ui.dialogs.FileSystemElement
addChild, getAdapter, getFileNameExtension, getFiles, getFileSystemObject, getFolders, getParent, isDirectory, removeFolder, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedFileSystemElement

public ExtendedFileSystemElement(File file,
                                 FileSystemElement parent)
Constructs a new instance. This instance is not flagged as being the input element for a viewer.

Parameters:
file - the file represented by this object..
parent - the parent, if any.

ExtendedFileSystemElement

public ExtendedFileSystemElement(File file,
                                 boolean inputElement)
Constructs a new instance.

Parameters:
file - the file represented by this object..
inputElement - true if this element is being used as the input element for a viewer.
Method Detail

isInputElement

public boolean isInputElement()
Returns whether or not this element was flagged as being used as a viewer's input element.

Returns:
true if this element is being used as a viewer's input element.

isVisited

public boolean isVisited()
Checks if the element has already been visited. Visited objects can be trusted to return correct results for getFiles() and getFolders().

Returns:
true if the element has already been visited, false otherwise.

visit

public void visit()
Indicates that this object has now been visited.


getFile

public File getFile()
Returns the file this object represents.

Returns:
the file.

setFileSystemObject

public void setFileSystemObject(Object value)

Overrides:
setFileSystemObject in class FileSystemElement