edu.rice.cs.util.swing
Class FileDisplay

java.lang.Object
  extended by edu.rice.cs.util.swing.FileDisplay

public class FileDisplay
extends Object

This class is a wrapper for a file whose toString method outputs only the last element in the file path. If it's a file, then it outputs the file name without its parent directories. If it's a directory, then it outputs the name of that directory only


Field Summary
protected  FileDisplayManager _fdm
           
 
Method Summary
protected  String formatRep(File file)
           
protected static String getDefaultNewFileRep()
           
 File getFile()
           
 File getParentFile()
           
 String getRepresentation()
           
 boolean isEditable()
          If the representation of the file is different from the underlying child string of the path, then the node represented by this file display cannot be edited.
 boolean isNew()
           
static FileDisplay newFile(File parent, FileDisplayManager fdm)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_fdm

protected FileDisplayManager _fdm
Method Detail

newFile

public static FileDisplay newFile(File parent,
                                  FileDisplayManager fdm)

getParentFile

public File getParentFile()

getFile

public File getFile()

isEditable

public boolean isEditable()
If the representation of the file is different from the underlying child string of the path, then the node represented by this file display cannot be edited. If the user edited the text by giving a new representation, there is no way to determine what the new child string of the path should be. However, if the user is creating a new node in the tree, they will be able to edit it.


isNew

public boolean isNew()

getRepresentation

public String getRepresentation()

toString

public final String toString()
Overrides:
toString in class Object

formatRep

protected String formatRep(File file)

getDefaultNewFileRep

protected static String getDefaultNewFileRep()