edu.rice.cs.util.swing
Class DefaultFileDisplayManager

java.lang.Object
  extended by edu.rice.cs.util.swing.DefaultFileDisplayManager
All Implemented Interfaces:
DisplayManager<File>, FileDisplayManager

public class DefaultFileDisplayManager
extends Object
implements FileDisplayManager

This FileDisplayManager uses the same icons and naming schemes as the JFileChooser offered by swing.


Constructor Summary
DefaultFileDisplayManager()
           
 
Method Summary
 Icon getIcon(File f)
          Given a file, decide which icon to use
 String getName(File f)
          Given a file, decide on which name to display for it
 FileDisplay makeFileDisplay(File f)
          Creates a file display that displays a file as this manager specifies
 FileDisplay makeFileDisplay(File parent, String child)
          Creates a file display that displays a file as this manager specifies
 FileDisplay makeNewFolderDisplay(File parent)
          Creates a FileDisplay representing a new untitled folder that is yet to be created.
 void update()
          Updates the UI to reflect any changes in the fs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFileDisplayManager

public DefaultFileDisplayManager()
Method Detail

getIcon

public Icon getIcon(File f)
Given a file, decide which icon to use

Specified by:
getIcon in interface DisplayManager<File>
Parameters:
f - The file to base the icon decision on
Returns:
The icon to display for the given file

getName

public String getName(File f)
Given a file, decide on which name to display for it

Specified by:
getName in interface DisplayManager<File>
Parameters:
f - The file to base the naming decison on
Returns:
The name to display for the file

makeFileDisplay

public FileDisplay makeFileDisplay(File f)
Creates a file display that displays a file as this manager specifies

Specified by:
makeFileDisplay in interface FileDisplayManager
Parameters:
f - the file to display using the display manager
Returns:
the file display object used to display a file's name

makeFileDisplay

public FileDisplay makeFileDisplay(File parent,
                                   String child)
Creates a file display that displays a file as this manager specifies

Specified by:
makeFileDisplay in interface FileDisplayManager
Parameters:
parent - the parent of the file to display using the display manager
child - the name of the child such that new File(parent, child) is the file to be displayed.
Returns:
the file display object used to display a file's name

makeNewFolderDisplay

public FileDisplay makeNewFolderDisplay(File parent)
Creates a FileDisplay representing a new untitled folder that is yet to be created.

Specified by:
makeNewFolderDisplay in interface FileDisplayManager
Parameters:
parent - the parent folder of the new folder
Returns:
the new file display

update

public void update()
Updates the UI to reflect any changes in the fs.

Specified by:
update in interface FileDisplayManager