1 33 34 package edu.rice.cs.util.swing; 35 36 import javax.swing.Icon ; 37 import javax.swing.JFileChooser ; 38 import java.io.File ; 39 40 41 public class DefaultFileDisplayManager implements FileDisplayManager { 42 43 private JFileChooser _jfc; 44 45 public DefaultFileDisplayManager() { _jfc = new JFileChooser (); } 46 47 51 public Icon getIcon(File f) { 52 if (f != null && ! f.exists()) f = null; 54 55 return _jfc.getIcon(f); 56 } 57 58 62 public String getName(File f) { return _jfc.getName(f); } 63 64 68 public FileDisplay makeFileDisplay(File f) { return new FileDisplay(f, this); } 69 70 76 public FileDisplay makeFileDisplay(File parent, String child) { return new FileDisplay(parent, child, this); } 77 78 82 public FileDisplay makeNewFolderDisplay(File parent) { return FileDisplay.newFile(parent, this); } 83 84 85 public void update() { _jfc.updateUI(); } 86 } | Popular Tags |