< prev index next >

## src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java

Print this page

    rev 48858 : Work in progress for JDK-6303622
    Use generic in Swing components like JComboBox
    1. Added generic return type and parameter type for JComboBox.
    2. Modified JList related classes as well.
    3. Reverted the changes made to "getSelectedValues" as suggested by Joe.
    4. Modified files that were failing on Linux and Mac as well.

    *** 832,847 ****

              public int getDepth(int i) {
                  return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
              }

    !         public void setSelectedItem(Object selectedDirectory) {
    !             this.selectedDirectory = (File)selectedDirectory;
                  fireContentsChanged(this, -1, -1);
              }

    !         public Object getSelectedItem() {
                  return selectedDirectory;
              }

              public int getSize() {
                  return directories.size();
    --- 832,849 ----

              public int getDepth(int i) {
                  return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
              }

    !         @Override
    !         public void setSelectedItem(File selectedDirectory) {
    !             this.selectedDirectory = selectedDirectory;
                  fireContentsChanged(this, -1, -1);
              }

    !         @Override
    !         public File getSelectedItem() {
                  return selectedDirectory;
              }

              public int getSize() {
                  return directories.size();
    *** 933,950 ****
                  } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
                      fireContentsChanged(this, -1, -1);
                  }
              }

    !         public void setSelectedItem(Object filter) {
                  if(filter != null) {
    !                 getFileChooser().setFileFilter((FileFilter) filter);
                      fireContentsChanged(this, -1, -1);
                  }
              }

    !         public Object getSelectedItem() {
                  // Ensure that the current filter is in the list.
                  // NOTE: we shouldnt' have to do this, since JFileChooser adds
                  // the filter to the choosable filters list when the filter
                  // is set. Lets be paranoid just in case someone overrides
                  // setFileFilter in JFileChooser.
    --- 935,952 ----
                  } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
                      fireContentsChanged(this, -1, -1);
                  }
              }

    !         public void setSelectedItem(FileFilter filter) {
                  if(filter != null) {
    !                 getFileChooser().setFileFilter(filter);
                      fireContentsChanged(this, -1, -1);
                  }
              }

    !         public FileFilter getSelectedItem() {
                  // Ensure that the current filter is in the list.
                  // NOTE: we shouldnt' have to do this, since JFileChooser adds
                  // the filter to the choosable filters list when the filter
                  // is set. Lets be paranoid just in case someone overrides
                  // setFileFilter in JFileChooser.

< prev index next >