summaryrefslogtreecommitdiff
path: root/javax/swing/plaf/basic/BasicFileChooserUI.java
diff options
context:
space:
mode:
authorAnthony Balkissoon <abalkiss@redhat.com>2005-08-31 20:00:43 +0000
committerAnthony Balkissoon <abalkiss@redhat.com>2005-08-31 20:00:43 +0000
commit72aac9545cb7d649a067594d257258700eb2edf9 (patch)
tree8c9c2a17f068240c3054771c3ba28e0f6b79204c /javax/swing/plaf/basic/BasicFileChooserUI.java
parentc9a11c5ee7a05137aae18a26db9ae948d8b58592 (diff)
downloadclasspath-72aac9545cb7d649a067594d257258700eb2edf9.tar.gz
2005-08-31 Anthony Balkissoon <abalkiss@redhat.com>
* javax/swing/plaf/basic/BasicFileChooserUI.java: (boxEntries): Made this method package private because I added a call to it from an implicitly defined listener class. Also fixed indentation. (createPropertyChangeListener): If the returned property listener hears DIRECTORY_CHANGED_PROPERTY, call boxEntries() to update the look-in box entries.
Diffstat (limited to 'javax/swing/plaf/basic/BasicFileChooserUI.java')
-rw-r--r--javax/swing/plaf/basic/BasicFileChooserUI.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/javax/swing/plaf/basic/BasicFileChooserUI.java b/javax/swing/plaf/basic/BasicFileChooserUI.java
index fd34fbd62..f74e92298 100644
--- a/javax/swing/plaf/basic/BasicFileChooserUI.java
+++ b/javax/swing/plaf/basic/BasicFileChooserUI.java
@@ -1090,7 +1090,9 @@ public class BasicFileChooserUI extends FileChooserUI
}
// FIXME: Indent the entries in the combobox
- private void boxEntries()
+ // Made this method package private to access it from within inner classes
+ // with better performance
+ void boxEntries()
{
ArrayList parentFiles = new ArrayList();
File parent = filechooser.getCurrentDirectory();
@@ -1098,12 +1100,12 @@ public class BasicFileChooserUI extends FileChooserUI
parent = filechooser.getFileSystemView().getDefaultDirectory();
while (parent != null)
{
- String name = parent.getName();
- if (name.equals(""))
- name = parent.getAbsolutePath();
+ String name = parent.getName();
+ if (name.equals(""))
+ name = parent.getAbsolutePath();
- parentFiles.add(parentFiles.size(), name);
- parent = parent.getParentFile();
+ parentFiles.add(parentFiles.size(), name);
+ parent = parent.getParentFile();
}
if (parentFiles.size() == 0)
@@ -1509,12 +1511,12 @@ public class BasicFileChooserUI extends FileChooserUI
}
else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY))
{
- //boxEntries();
filelist.clearSelection();
filelist.revalidate();
filelist.repaint();
setDirectorySelected(false);
setDirectory(filechooser.getCurrentDirectory());
+ boxEntries();
}
else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)
|| e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY))