diff options
author | Roman Kennke <roman@kennke.org> | 2006-08-02 11:31:42 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2006-08-02 11:31:42 +0000 |
commit | 96e691c80b4df8929bf41dded5119b067ab7524c (patch) | |
tree | 74bc82045bb91a31e52af6a2cc52f7fa822a9d13 /javax/swing/plaf/basic/BasicFileChooserUI.java | |
parent | 376fefd18a289818077838e682923fc3930bc969 (diff) | |
download | classpath-96e691c80b4df8929bf41dded5119b067ab7524c.tar.gz |
2006-08-02 Roman Kennke <kennke@aicas.com>
PR 27604
* javax/swing/plaf/basic/BasicChooserUI.java
(BasicFileView.getName): Fetch the real name from the
file chooser's FileSystemView.
* javax/swing/plaf/metal/MetalChooserUI.java
(DirectoryComboBoxRenderer.getListCellRendererComponent):
Set the text fetched from the JFileChooser.getName().
* javax/swing/FileSystemView.java
(createFileObject): When file is a filesystem root,
create a filesystem root object first.
(getSystemDisplayName): Return the filename. Added specnote
about ShellFolder class that is mentioned in the spec.
* javax/swing/UnixFileSystemView.java
(getSystemDisplayName): Implemented to return the real name
of a file, special handling files like '.' or '..'.
Diffstat (limited to 'javax/swing/plaf/basic/BasicFileChooserUI.java')
-rw-r--r-- | javax/swing/plaf/basic/BasicFileChooserUI.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/javax/swing/plaf/basic/BasicFileChooserUI.java b/javax/swing/plaf/basic/BasicFileChooserUI.java index 52b7f5720..67c300187 100644 --- a/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -268,7 +268,14 @@ public class BasicFileChooserUI extends FileChooserUI */ public String getName(File f) { - return f.getName(); + String name = null; + if (f != null) + { + JFileChooser c = getFileChooser(); + FileSystemView v = c.getFileSystemView(); + name = v.getSystemDisplayName(f); + } + return name; } /** |