src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -279,10 +279,11 @@
public void installComponents(JFileChooser fc) {
fc.setLayout(new BorderLayout(10, 10));
fc.setAlignmentX(JComponent.CENTER_ALIGNMENT);
+ @SuppressWarnings("serial") // anonymous class
JPanel interior = new JPanel() {
public Insets getInsets() {
return insets;
}
};
@@ -301,17 +302,20 @@
File currentDirectory = fc.getCurrentDirectory();
String curDirName = null;
if(currentDirectory != null) {
curDirName = currentDirectory.getPath();
}
- pathField = new JTextField(curDirName) {
+
+ @SuppressWarnings("serial") // anonymous class
+ JTextField tmp1 = new JTextField(curDirName) {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
+ pathField = tmp1;
pathField.setInheritsPopupMenu(true);
l.setLabelFor(pathField);
align(pathField);
// Change to folder on return
@@ -335,17 +339,19 @@
l = new JLabel(filterLabelText);
l.setDisplayedMnemonic(filterLabelMnemonic);
align(l);
leftPanel.add(l);
- filterComboBox = new JComboBox<FileFilter>() {
+ @SuppressWarnings("serial") // anonymous class
+ JComboBox tmp2 = new JComboBox<FileFilter>() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
+ filterComboBox = tmp2;
filterComboBox.setInheritsPopupMenu(true);
l.setLabelFor(filterComboBox);
filterComboBoxModel = createFilterComboBoxModel();
filterComboBox.setModel(filterComboBoxModel);
filterComboBox.setRenderer(createFilterComboBoxRenderer());
@@ -411,17 +417,19 @@
fileNameLabel = new JLabel();
populateFileNameLabel();
align(fileNameLabel);
interior.add(fileNameLabel);
- filenameTextField = new JTextField() {
+ @SuppressWarnings("serial") // anonymous class
+ JTextField tmp3 = new JTextField() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
+ filenameTextField = tmp3;
filenameTextField.setInheritsPopupMenu(true);
fileNameLabel.setLabelFor(filenameTextField);
filenameTextField.addActionListener(getApproveSelectionAction());
align(filenameTextField);
filenameTextField.setAlignmentX(JComponent.LEFT_ALIGNMENT);
@@ -434,24 +442,27 @@
JPanel buttonPanel = new JPanel();
align(buttonPanel);
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
buttonPanel.add(Box.createGlue());
- approveButton = new JButton(getApproveButtonText(fc)) {
+ @SuppressWarnings("serial") // anonymous class
+ JButton tmp4 = new JButton(getApproveButtonText(fc)) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
+ approveButton = tmp4;
approveButton.setMnemonic(getApproveButtonMnemonic(fc));
approveButton.setToolTipText(getApproveButtonToolTipText(fc));
approveButton.setInheritsPopupMenu(true);
align(approveButton);
approveButton.setMargin(buttonMargin);
approveButton.addActionListener(getApproveSelectionAction());
buttonPanel.add(approveButton);
buttonPanel.add(Box.createGlue());
+ @SuppressWarnings("serial") // anonymous class
JButton updateButton = new JButton(updateButtonText) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
@@ -462,10 +473,11 @@
updateButton.setMargin(buttonMargin);
updateButton.addActionListener(getUpdateAction());
buttonPanel.add(updateButton);
buttonPanel.add(Box.createGlue());
+ @SuppressWarnings("serial") // anonymous class
JButton cancelButton = new JButton(cancelButtonText) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
@@ -476,10 +488,11 @@
cancelButton.setMargin(buttonMargin);
cancelButton.addActionListener(getCancelSelectionAction());
buttonPanel.add(cancelButton);
buttonPanel.add(Box.createGlue());
+ @SuppressWarnings("serial") // anonymous class
JButton helpButton = new JButton(helpButtonText) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
@@ -638,10 +651,11 @@
protected void align(JComponent c) {
c.setAlignmentX(JComponent.LEFT_ALIGNMENT);
c.setAlignmentY(JComponent.TOP_ALIGNMENT);
}
+ @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);
@@ -649,10 +663,11 @@
setInheritsPopupMenu(true);
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);
@@ -660,10 +675,11 @@
setInheritsPopupMenu(true);
return this;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
protected class MotifDirectoryListModel extends AbstractListModel<File> implements ListDataListener {
public MotifDirectoryListModel() {
getModel().addListDataListener(this);
}
@@ -696,10 +712,11 @@
fireContentsChanged();
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
protected class MotifFileListModel extends AbstractListModel<File> implements ListDataListener {
public MotifFileListModel() {
getModel().addListDataListener(this);
}
@@ -757,10 +774,11 @@
/**
* Render different type sizes and styles.
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public class FilterComboBoxRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list,
Object value, int index, boolean isSelected,
boolean cellHasFocus) {
@@ -775,10 +793,11 @@
}
/**
* Data model for a type-face selection combo-box.
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
protected class FilterComboBoxModel extends AbstractListModel<FileFilter> implements ComboBoxModel<FileFilter>,
PropertyChangeListener {
protected FileFilter[] filters;
protected FilterComboBoxModel() {
super();