src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
Print this page
*** 56,66 ****
// the windows implementation, but using Metal themed buttons, lists,
// icons, etc. We are planning a complete rewrite, and hence we've
// made most things in this class private.
private JLabel lookInLabel;
! private JComboBox directoryComboBox;
private DirectoryComboBoxModel directoryComboBoxModel;
private Action directoryComboBoxAction = new DirectoryComboBoxAction();
private FilterComboBoxModel filterComboBoxModel;
--- 56,66 ----
// the windows implementation, but using Metal themed buttons, lists,
// icons, etc. We are planning a complete rewrite, and hence we've
// made most things in this class private.
private JLabel lookInLabel;
! private JComboBox<Object> directoryComboBox;
private DirectoryComboBoxModel directoryComboBoxModel;
private Action directoryComboBoxAction = new DirectoryComboBoxAction();
private FilterComboBoxModel filterComboBoxModel;
*** 74,84 ****
private JButton cancelButton;
private JPanel buttonPanel;
private JPanel bottomPanel;
! private JComboBox filterComboBox;
private static final Dimension hstrut5 = new Dimension(5, 1);
private static final Dimension hstrut11 = new Dimension(11, 1);
private static final Dimension vstrut5 = new Dimension(1, 5);
--- 74,84 ----
private JButton cancelButton;
private JPanel buttonPanel;
private JPanel bottomPanel;
! private JComboBox<?> filterComboBox;
private static final Dimension hstrut5 = new Dimension(5, 1);
private static final Dimension hstrut11 = new Dimension(11, 1);
private static final Dimension vstrut5 = new Dimension(1, 5);
*** 194,204 ****
public Action getNewFolderAction() {
return MetalFileChooserUI.this.getNewFolderAction();
}
! public MouseListener createDoubleClickListener(JList list) {
return MetalFileChooserUI.this.createDoubleClickListener(getFileChooser(),
list);
}
public ListSelectionListener createListSelectionListener() {
--- 194,204 ----
public Action getNewFolderAction() {
return MetalFileChooserUI.this.getNewFolderAction();
}
! public MouseListener createDoubleClickListener(JList<?> list) {
return MetalFileChooserUI.this.createDoubleClickListener(getFileChooser(),
list);
}
public ListSelectionListener createListSelectionListener() {
*** 233,243 ****
lookInLabel.setDisplayedMnemonic(lookInLabelMnemonic);
topPanel.add(lookInLabel, BorderLayout.BEFORE_LINE_BEGINS);
// CurrentDir ComboBox
@SuppressWarnings("serial") // anonymous class
! JComboBox tmp1 = new JComboBox() {
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
// Must be small enough to not affect total width.
d.width = 150;
return d;
--- 233,243 ----
lookInLabel.setDisplayedMnemonic(lookInLabelMnemonic);
topPanel.add(lookInLabel, BorderLayout.BEFORE_LINE_BEGINS);
// CurrentDir ComboBox
@SuppressWarnings("serial") // anonymous class
! JComboBox<Object> tmp1 = new JComboBox<Object>() {
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
// Must be small enough to not affect total width.
d.width = 150;
return d;
*** 416,426 ****
filesOfTypeLabel.setDisplayedMnemonic(filesOfTypeLabelMnemonic);
filesOfTypePanel.add(filesOfTypeLabel);
filterComboBoxModel = createFilterComboBoxModel();
fc.addPropertyChangeListener(filterComboBoxModel);
! filterComboBox = new JComboBox(filterComboBoxModel);
filterComboBox.putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY,
filesOfTypeLabelText);
filesOfTypeLabel.setLabelFor(filterComboBox);
filterComboBox.setRenderer(createFilterComboBoxRenderer());
filesOfTypePanel.add(filterComboBox);
--- 416,426 ----
filesOfTypeLabel.setDisplayedMnemonic(filesOfTypeLabelMnemonic);
filesOfTypePanel.add(filesOfTypeLabel);
filterComboBoxModel = createFilterComboBoxModel();
fc.addPropertyChangeListener(filterComboBoxModel);
! filterComboBox = new JComboBox<>(filterComboBoxModel);
filterComboBox.putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY,
filesOfTypeLabelText);
filesOfTypeLabel.setLabelFor(filterComboBox);
filterComboBox.setRenderer(createFilterComboBoxRenderer());
filesOfTypePanel.add(filterComboBox);
*** 531,541 ****
return super.createListSelectionListener(fc);
}
// Obsolete class, not used in this version.
protected class SingleClickListener extends MouseAdapter {
! public SingleClickListener(JList list) {
}
}
// Obsolete class, not used in this version.
@SuppressWarnings("serial") // Superclass is not serializable across versions
--- 531,541 ----
return super.createListSelectionListener(fc);
}
// Obsolete class, not used in this version.
protected class SingleClickListener extends MouseAdapter {
! public SingleClickListener(JList<?> list) {
}
}
// Obsolete class, not used in this version.
@SuppressWarnings("serial") // Superclass is not serializable across versions
*** 859,869 ****
// Renderer for DirectoryComboBox
//
@SuppressWarnings("serial") // Superclass is not serializable across versions
class DirectoryComboBoxRenderer extends DefaultListCellRenderer {
IndentIcon ii = new IndentIcon();
! public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
--- 859,869 ----
// Renderer for DirectoryComboBox
//
@SuppressWarnings("serial") // Superclass is not serializable across versions
class DirectoryComboBoxRenderer extends DefaultListCellRenderer {
IndentIcon ii = new IndentIcon();
! public Component getListCellRendererComponent(JList<?> list, Object value,
int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
*** 1049,1059 ****
/**
* 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) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
--- 1049,1059 ----
/**
* 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) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);