src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
Print this page
@@ -547,10 +547,11 @@
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,30 +659,34 @@
File currentDirectory = fc.getCurrentDirectory();
String curDirName = null;
if (currentDirectory != null) {
curDirName = currentDirectory.getPath();
}
- pathField = new JLabel(curDirName) {
+ @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
- fileNameTextField = new JTextField() {
+ @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,10 +908,11 @@
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,10 +927,11 @@
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,10 +971,11 @@
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,10 +1015,11 @@
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,10 +1029,11 @@
}
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,10 +1092,11 @@
}
/**
* 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,10 +1169,11 @@
}
/**
* 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,10 +1184,11 @@
}
/**
* 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,10 +1220,11 @@
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,10 +1252,11 @@
}
/**
* 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,10 +1298,11 @@
}
/**
* 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,10 +1342,11 @@
}
/**
* Data model for filter combo-box.
*/
+ @SuppressWarnings("serial") // JDK implementation class
protected class FilterComboBoxModel extends AbstractListModel
implements ComboBoxModel, PropertyChangeListener {
protected FileFilter[] filters;
protected FilterComboBoxModel() {