src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java

Print this page

        

*** 547,556 **** --- 547,557 ---- align(interior); interior.setLayout(new BoxLayout(interior, BoxLayout.PAGE_AXIS)); fc.add(interior, BorderLayout.CENTER); + @SuppressWarnings("serial") // anonymous class JPanel comboBoxPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0) { public void layoutContainer(Container target) { super.layoutContainer(target); JComboBox comboBox = directoryComboBox;
*** 658,687 **** File currentDirectory = fc.getCurrentDirectory(); String curDirName = null; if (currentDirectory != null) { curDirName = currentDirectory.getPath(); } ! pathField = new JLabel(curDirName) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; return d; } }; pathField.setName("GTKFileChooser.pathField"); align(pathField); pathFieldPanel.add(pathField); interior.add(pathFieldPanel); // add the fileName field ! fileNameTextField = new JTextField() { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; return d; } }; pathFieldLabel.setLabelFor(fileNameTextField); Set<AWTKeyStroke> forwardTraversalKeys = fileNameTextField.getFocusTraversalKeys( KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); --- 659,692 ---- File currentDirectory = fc.getCurrentDirectory(); String curDirName = null; if (currentDirectory != null) { curDirName = currentDirectory.getPath(); } ! @SuppressWarnings("serial") // anonymous class ! JLabel tmp = new JLabel(curDirName) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; return d; } }; + pathField = tmp; pathField.setName("GTKFileChooser.pathField"); align(pathField); pathFieldPanel.add(pathField); interior.add(pathFieldPanel); // add the fileName field ! @SuppressWarnings("serial") // anonymous class ! JTextField tmp2 = new JTextField() { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; return d; } }; + fileNameTextField = tmp2; pathFieldLabel.setLabelFor(fileNameTextField); Set<AWTKeyStroke> forwardTraversalKeys = fileNameTextField.getFocusTraversalKeys( KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
*** 903,912 **** --- 908,918 ---- public Action getApproveSelectionAction() { return approveSelectionAction; } + @SuppressWarnings("serial") // Superclass is not serializable across versions private class GTKDirectoryModel extends BasicDirectoryModel { FileSystemView fsv; private Comparator<File> fileComparator = new Comparator<File>() { public int compare(File o, File o1) { return fsv.getSystemDisplayName(o).compareTo(fsv.getSystemDisplayName(o1));
*** 921,930 **** --- 927,937 ---- fsv = getFileChooser().getFileSystemView(); Collections.sort(v, fileComparator); } } + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class GTKDirectoryListModel extends AbstractListModel implements ListDataListener { File curDir; public GTKDirectoryListModel() { getModel().addListDataListener(this); directoryChanged();
*** 964,973 **** --- 971,981 ---- curDir = getFileChooser().getFileSystemView().createFileObject( getFileChooser().getCurrentDirectory(), "."); } } + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class GTKFileListModel extends AbstractListModel implements ListDataListener { public GTKFileListModel() { getModel().addListDataListener(this); }
*** 1007,1016 **** --- 1015,1025 ---- fireContentsChanged(); } } + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class FileCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
*** 1020,1029 **** --- 1029,1039 ---- } return this; } } + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class DirectoryCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
*** 1082,1091 **** --- 1092,1102 ---- } /** * Data model for a type-face selection combo-box. */ + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector<File> directories = new Vector<File>(); File selectedDirectory = null; JFileChooser chooser = getFileChooser(); FileSystemView fsv = chooser.getFileSystemView();
*** 1158,1167 **** --- 1169,1179 ---- } /** * Acts when DirectoryComboBox has changed the selected item. */ + @SuppressWarnings("serial") // Superclass is not serializable across versions protected class DirectoryComboBoxAction extends AbstractAction { protected DirectoryComboBoxAction() { super("DirectoryComboBoxAction"); }
*** 1172,1181 **** --- 1184,1194 ---- } /** * Creates a new folder. */ + @SuppressWarnings("serial") // Superclass is not serializable across versions private class NewFolderAction extends AbstractAction { protected NewFolderAction() { super(FilePane.ACTION_NEW_FOLDER); } public void actionPerformed(ActionEvent e) {
*** 1207,1216 **** --- 1220,1230 ---- fc.rescanCurrentDirectory(); } } } + @SuppressWarnings("serial") // Superclass is not serializable across versions private class GTKApproveSelectionAction extends ApproveSelectionAction { public void actionPerformed(ActionEvent e) { if (isDirectorySelected()) { File dir = getDirectory(); try {
*** 1238,1247 **** --- 1252,1262 ---- } /** * Renames file */ + @SuppressWarnings("serial") // Superclass is not serializable across versions private class RenameFileAction extends AbstractAction { protected RenameFileAction() { super(FilePane.ACTION_EDIT_FILE_NAME); } public void actionPerformed(ActionEvent e) {
*** 1283,1292 **** --- 1298,1308 ---- } /** * Render different filters */ + @SuppressWarnings("serial") // Superclass is not serializable across versions public class FilterComboBoxRenderer extends DefaultListCellRenderer implements UIResource { public String getName() { // As SynthComboBoxRenderer's are asked for a size BEFORE they // are parented getName is overriden to force the name to be // ComboBox.renderer if it isn't set. If we didn't do this the
*** 1326,1335 **** --- 1342,1352 ---- } /** * Data model for filter combo-box. */ + @SuppressWarnings("serial") // JDK implementation class protected class FilterComboBoxModel extends AbstractListModel implements ComboBoxModel, PropertyChangeListener { protected FileFilter[] filters; protected FilterComboBoxModel() {