src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2010, 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
--- 1,7 ----
/*
! * 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
*** 280,289 ****
--- 280,290 ----
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;
}
};
*** 302,318 ****
File currentDirectory = fc.getCurrentDirectory();
String curDirName = null;
if(currentDirectory != null) {
curDirName = currentDirectory.getPath();
}
! pathField = new JTextField(curDirName) {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
pathField.setInheritsPopupMenu(true);
l.setLabelFor(pathField);
align(pathField);
// Change to folder on return
--- 303,322 ----
File currentDirectory = fc.getCurrentDirectory();
String curDirName = null;
if(currentDirectory != null) {
curDirName = currentDirectory.getPath();
}
!
! @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
*** 336,352 ****
l = new JLabel(filterLabelText);
l.setDisplayedMnemonic(filterLabelMnemonic);
align(l);
leftPanel.add(l);
! filterComboBox = new JComboBox<FileFilter>() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
filterComboBox.setInheritsPopupMenu(true);
l.setLabelFor(filterComboBox);
filterComboBoxModel = createFilterComboBoxModel();
filterComboBox.setModel(filterComboBoxModel);
filterComboBox.setRenderer(createFilterComboBoxRenderer());
--- 340,358 ----
l = new JLabel(filterLabelText);
l.setDisplayedMnemonic(filterLabelMnemonic);
align(l);
leftPanel.add(l);
! @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());
*** 412,428 ****
fileNameLabel = new JLabel();
populateFileNameLabel();
align(fileNameLabel);
interior.add(fileNameLabel);
! filenameTextField = new JTextField() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height;
return d;
}
};
filenameTextField.setInheritsPopupMenu(true);
fileNameLabel.setLabelFor(filenameTextField);
filenameTextField.addActionListener(getApproveSelectionAction());
align(filenameTextField);
filenameTextField.setAlignmentX(JComponent.LEFT_ALIGNMENT);
--- 418,436 ----
fileNameLabel = new JLabel();
populateFileNameLabel();
align(fileNameLabel);
interior.add(fileNameLabel);
! @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);
*** 435,458 ****
JPanel buttonPanel = new JPanel();
align(buttonPanel);
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
buttonPanel.add(Box.createGlue());
! approveButton = new JButton(getApproveButtonText(fc)) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
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());
JButton updateButton = new JButton(updateButtonText) {
public Dimension getMaximumSize() {
return new Dimension(MAX_SIZE.width, this.getPreferredSize().height);
}
};
--- 443,469 ----
JPanel buttonPanel = new JPanel();
align(buttonPanel);
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
buttonPanel.add(Box.createGlue());
! @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);
}
};
*** 463,472 ****
--- 474,484 ----
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);
}
};
*** 477,486 ****
--- 489,499 ----
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);
}
};
*** 639,648 ****
--- 652,662 ----
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);
*** 650,659 ****
--- 664,674 ----
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);
*** 661,670 ****
--- 676,686 ----
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);
}
*** 697,706 ****
--- 713,723 ----
fireContentsChanged();
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
protected class MotifFileListModel extends AbstractListModel<File> implements ListDataListener {
public MotifFileListModel() {
getModel().addListDataListener(this);
}
*** 758,767 ****
--- 775,785 ----
/**
* 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) {
*** 776,785 ****
--- 794,804 ----
}
/**
* Data model for a type-face selection combo-box.
*/
+ @SuppressWarnings("serial") // Superclass is a JDK-implementation class
protected class FilterComboBoxModel extends AbstractFilterComboBoxModel {
protected JFileChooser getFileChooser() {
return MotifFileChooserUI.this.getFileChooser();
}
}