src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java

Print this page

        

@@ -56,11 +56,11 @@
     // 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 JComboBox<Object> directoryComboBox;
     private DirectoryComboBoxModel directoryComboBoxModel;
     private Action directoryComboBoxAction = new DirectoryComboBoxAction();
 
     private FilterComboBoxModel filterComboBoxModel;
 

@@ -74,11 +74,11 @@
     private JButton cancelButton;
 
     private JPanel buttonPanel;
     private JPanel bottomPanel;
 
-    private JComboBox filterComboBox;
+    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,11 +194,11 @@
 
         public Action getNewFolderAction() {
             return MetalFileChooserUI.this.getNewFolderAction();
         }
 
-        public MouseListener createDoubleClickListener(JList list) {
+        public MouseListener createDoubleClickListener(JList<?> list) {
             return MetalFileChooserUI.this.createDoubleClickListener(getFileChooser(),
                                                                      list);
         }
 
         public ListSelectionListener createListSelectionListener() {

@@ -233,11 +233,11 @@
         lookInLabel.setDisplayedMnemonic(lookInLabelMnemonic);
         topPanel.add(lookInLabel, BorderLayout.BEFORE_LINE_BEGINS);
 
         // CurrentDir ComboBox
         @SuppressWarnings("serial") // anonymous class
-        JComboBox tmp1 = new JComboBox() {
+        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,11 +416,11 @@
         filesOfTypeLabel.setDisplayedMnemonic(filesOfTypeLabelMnemonic);
         filesOfTypePanel.add(filesOfTypeLabel);
 
         filterComboBoxModel = createFilterComboBoxModel();
         fc.addPropertyChangeListener(filterComboBoxModel);
-        filterComboBox = new JComboBox(filterComboBoxModel);
+        filterComboBox = new JComboBox<>(filterComboBoxModel);
         filterComboBox.putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY,
                                          filesOfTypeLabelText);
         filesOfTypeLabel.setLabelFor(filterComboBox);
         filterComboBox.setRenderer(createFilterComboBoxRenderer());
         filesOfTypePanel.add(filterComboBox);

@@ -531,11 +531,11 @@
         return super.createListSelectionListener(fc);
     }
 
     // Obsolete class, not used in this version.
     protected class SingleClickListener extends MouseAdapter {
-        public  SingleClickListener(JList list) {
+        public  SingleClickListener(JList<?> list) {
         }
     }
 
     // Obsolete class, not used in this version.
     @SuppressWarnings("serial") // Superclass is not serializable across versions

@@ -859,11 +859,11 @@
     // 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,
+        public Component getListCellRendererComponent(JList<?> list, Object value,
                                                       int index, boolean isSelected,
                                                       boolean cellHasFocus) {
 
             super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
 

@@ -1049,11 +1049,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,
+        public Component getListCellRendererComponent(JList<?> list,
             Object value, int index, boolean isSelected,
             boolean cellHasFocus) {
 
             super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);