diff options
author | Guilhem Lavaux <guilhem@kaffe.org> | 2006-06-08 20:19:53 +0000 |
---|---|---|
committer | Guilhem Lavaux <guilhem@kaffe.org> | 2006-06-08 20:19:53 +0000 |
commit | 2f94810a11e0e3cdeb4bed695a4bf9eb9ce41c34 (patch) | |
tree | c5e2c0011d6dd129dbdc8da0273cdaff7b1bc3f6 /javax/swing/plaf/metal/MetalFileChooserUI.java | |
parent | 56c5b96a2d3754736d13eebb73270fb8f925301d (diff) | |
download | classpath-2f94810a11e0e3cdeb4bed695a4bf9eb9ce41c34.tar.gz |
2006-06-07 Guilhem Lavaux <guilhem@kaffe.org>native_layer_merge_head_2006_06_06
* Merged HEAD as of 2006-06-06.
* native/jni/native-lib/cpproc.h
(CPIO_EXEC_NUM_PIPES): Compilation fix.
Diffstat (limited to 'javax/swing/plaf/metal/MetalFileChooserUI.java')
-rw-r--r-- | javax/swing/plaf/metal/MetalFileChooserUI.java | 68 |
1 files changed, 29 insertions, 39 deletions
diff --git a/javax/swing/plaf/metal/MetalFileChooserUI.java b/javax/swing/plaf/metal/MetalFileChooserUI.java index cb94c87b8..1219ad9fd 100644 --- a/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -52,12 +52,13 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.text.NumberFormat; - import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; - import java.io.File; +import java.sql.Date; +import java.text.DateFormat; +import java.text.NumberFormat; +import java.util.List; import javax.swing.AbstractAction; import javax.swing.AbstractListModel; @@ -79,7 +80,6 @@ import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.JToggleButton; -import javax.swing.JViewport; import javax.swing.ListModel; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; @@ -94,12 +94,6 @@ import javax.swing.plaf.basic.BasicFileChooserUI; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; -import java.sql.Date; - -import java.text.DateFormat; - -import java.util.List; - /** * A UI delegate for the {@link JFileChooser} component. This class is only @@ -350,7 +344,7 @@ public class MetalFileChooserUI setDirectorySelected(false); File currentDirectory = filechooser.getCurrentDirectory(); setDirectory(currentDirectory); - boolean hasParent = (currentDirectory.getParentFile() != null); + boolean hasParent = currentDirectory.getParentFile() != null; getChangeToParentDirectoryAction().setEnabled(hasParent); } @@ -648,15 +642,15 @@ public class MetalFileChooserUI FileView v = getFileView(getFileChooser()); File f = (File) value; if (f != null) - { - setText(v.getName(f)); - setIcon(v.getIcon(f)); - } + { + setText(v.getName(f)); + setIcon(v.getIcon(f)); + } else - { - setText(""); - setIcon(null); - } + { + setText(""); + setIcon(null); + } setOpaque(true); if (isSelected) { @@ -962,10 +956,9 @@ public class MetalFileChooserUI { String text = editField.getText(); if (text != null && text != "" && !text.equals(fc.getName(editFile))) - if (editFile.renameTo - (fc.getFileSystemView().createFileObject - (fc.getCurrentDirectory(), text))) - rescanCurrentDirectory(fc); + if (editFile.renameTo(fc.getFileSystemView().createFileObject( + fc.getCurrentDirectory(), text))) + rescanCurrentDirectory(fc); list.remove(editField); } startEditing = false; @@ -1018,7 +1011,7 @@ public class MetalFileChooserUI JFileChooser fc; /** The last selected file. */ - Object lastSelected = null; + Object lastSelected; /** * Stores the current file that is being edited. @@ -1032,10 +1025,8 @@ public class MetalFileChooserUI /** * Creates a new listener. * - * @param table - * the directory/file table - * @param fc - * the JFileChooser + * @param table the directory/file table + * @param fc the JFileChooser */ public TableClickListener(JTable table, JFileChooser fc) { @@ -1051,8 +1042,7 @@ public class MetalFileChooserUI /** * Receives notification of a mouse click event. * - * @param e - * the event. + * @param e the event. */ public void mouseClicked(MouseEvent e) { @@ -1156,10 +1146,9 @@ public class MetalFileChooserUI { String text = editField.getText(); if (text != null && text != "" && !text.equals(fc.getName(editFile))) - if (editFile.renameTo - (fc.getFileSystemView().createFileObject - (fc.getCurrentDirectory(), text))) - rescanCurrentDirectory(fc); + if (editFile.renameTo(fc.getFileSystemView().createFileObject( + fc.getCurrentDirectory(), text))) + rescanCurrentDirectory(fc); table.remove(editField); } startEditing = false; @@ -1636,8 +1625,7 @@ public class MetalFileChooserUI /** * Formats bytes into the appropriate size. * - * @param bytes - - * the number of bytes to convert + * @param bytes the number of bytes to convert * @return a string representation of the size */ private String formatSize(long bytes) @@ -1838,7 +1826,7 @@ public class MetalFileChooserUI /** * Updates the current directory. * - * @param the file chooser to update. + * @param fc the file chooser to update. */ public void rescanCurrentDirectory(JFileChooser fc) { @@ -1966,7 +1954,8 @@ public class MetalFileChooserUI * * @param component the component. */ - public void removeLayoutComponent(Component component) { + public void removeLayoutComponent(Component component) + { // do nothing } } @@ -2072,7 +2061,8 @@ public class MetalFileChooserUI * * @param component the component. */ - public void removeLayoutComponent(Component component) { + public void removeLayoutComponent(Component component) + { // do nothing } } |