src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
Print this page
*** 434,458 ****
}
return handler;
}
protected MouseListener createDoubleClickListener(JFileChooser fc,
! JList list) {
return new Handler(list);
}
public ListSelectionListener createListSelectionListener(JFileChooser fc) {
return getHandler();
}
private class Handler implements MouseListener, ListSelectionListener {
! JList list;
Handler() {
}
! Handler(JList list) {
this.list = list;
}
public void mouseClicked(MouseEvent evt) {
// Note: we can't depend on evt.getSource() because of backward
--- 434,458 ----
}
return handler;
}
protected MouseListener createDoubleClickListener(JFileChooser fc,
! JList<?> list) {
return new Handler(list);
}
public ListSelectionListener createListSelectionListener(JFileChooser fc) {
return getHandler();
}
private class Handler implements MouseListener, ListSelectionListener {
! JList<?> list;
Handler() {
}
! Handler(JList<?> list) {
this.list = list;
}
public void mouseClicked(MouseEvent evt) {
// Note: we can't depend on evt.getSource() because of backward
*** 504,514 ****
public void valueChanged(ListSelectionEvent evt) {
if(!evt.getValueIsAdjusting()) {
JFileChooser chooser = getFileChooser();
FileSystemView fsv = chooser.getFileSystemView();
! JList list = (JList)evt.getSource();
int fsm = chooser.getFileSelectionMode();
boolean useSetDirectory = usesSingleFilePane &&
(fsm == JFileChooser.FILES_ONLY);
--- 504,515 ----
public void valueChanged(ListSelectionEvent evt) {
if(!evt.getValueIsAdjusting()) {
JFileChooser chooser = getFileChooser();
FileSystemView fsv = chooser.getFileSystemView();
! @SuppressWarnings("unchecked")
! JList<?> list = (JList)evt.getSource();
int fsm = chooser.getFileSelectionMode();
boolean useSetDirectory = usesSingleFilePane &&
(fsm == JFileChooser.FILES_ONLY);
*** 568,578 ****
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
Handler handler;
! public DoubleClickListener(JList list) {
handler = new Handler(list);
}
/**
* The JList used for representing the files is created by subclasses, but the
--- 569,579 ----
// NOTE: This class exists only for backward compatibility. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
Handler handler;
! public DoubleClickListener(JList<?> list) {
handler = new Handler(list);
}
/**
* The JList used for representing the files is created by subclasses, but the