src/share/classes/sun/swing/FilePane.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2009, 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) 2003, 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
*** 56,65 ****
--- 56,66 ----
* implementation of BasicFileChooserUI, and is intended to be API compatible
* with earlier implementations of MetalFileChooserUI and WindowsFileChooserUI.
*
* @author Leif Samuelsson
*/
+ @SuppressWarnings("serial") // JDK-implementation class
public class FilePane extends JPanel implements PropertyChangeListener {
// Constants for actions. These are used for the actions' ACTION_COMMAND_KEY
// and as keys in the action maps for FilePane and the corresponding UI classes
public final static String ACTION_APPROVE_SELECTION = "approveSelection";
*** 389,398 ****
--- 390,400 ----
repaint();
updateViewMenu();
firePropertyChange("viewType", oldValue, viewType);
}
+ @SuppressWarnings("serial") // JDK-implementation class
class ViewTypeAction extends AbstractAction {
private int viewType;
ViewTypeAction(int viewType) {
super(viewTypeActionNames[viewType]);
*** 468,477 ****
--- 470,480 ----
*
* @return the command list
*/
public Action[] getActions() {
if (actions == null) {
+ @SuppressWarnings("serial") // JDK-implementation class
class FilePaneAction extends AbstractAction {
FilePaneAction(String name) {
this(name, name);
}
*** 575,584 ****
--- 578,589 ----
}
public JPanel createList() {
JPanel p = new JPanel(new BorderLayout());
final JFileChooser fileChooser = getFileChooser();
+
+ @SuppressWarnings("serial") // anonymous class
final JList<Object> list = new JList<Object>() {
public int getNextMatch(String prefix, int startIndex, Position.Bias bias) {
ListModel model = getModel();
int max = model.getSize();
if (prefix == null || startIndex < 0 || startIndex >= max) {
*** 649,658 ****
--- 654,664 ----
}
/**
* This model allows for sorting JList
*/
+ @SuppressWarnings("serial") // JDK-implementation class
private class SortableListModel extends AbstractListModel<Object>
implements TableModelListener, RowSorterListener {
public SortableListModel() {
getDetailsTableModel().addTableModelListener(this);
*** 682,691 ****
--- 688,698 ----
detailsTableModel = new DetailsTableModel(getFileChooser());
}
return detailsTableModel;
}
+ @SuppressWarnings("serial") // JDK-implementation class
class DetailsTableModel extends AbstractTableModel implements ListDataListener {
JFileChooser chooser;
BasicDirectoryModel directoryModel;
ShellFolderColumnInfo[] columns;
*** 1001,1010 ****
--- 1008,1018 ----
tableCellEditor = new DetailsTableCellEditor(new JTextField());
}
return tableCellEditor;
}
+ @SuppressWarnings("serial") // JDK-implementation class
private class DetailsTableCellEditor extends DefaultCellEditor {
private final JTextField tf;
public DetailsTableCellEditor(JTextField tf) {
super(tf);
*** 1023,1033 ****
}
return comp;
}
}
!
class DetailsTableCellRenderer extends DefaultTableCellRenderer {
JFileChooser chooser;
DateFormat df;
DetailsTableCellRenderer(JFileChooser chooser) {
--- 1031,1041 ----
}
return comp;
}
}
! @SuppressWarnings("serial") // JDK-implementation class
class DetailsTableCellRenderer extends DefaultTableCellRenderer {
JFileChooser chooser;
DateFormat df;
DetailsTableCellRenderer(JFileChooser chooser) {
*** 1127,1136 ****
--- 1135,1145 ----
public JPanel createDetailsView() {
final JFileChooser chooser = getFileChooser();
JPanel p = new JPanel(new BorderLayout());
+ @SuppressWarnings("serial") // anonymous class
final JTable detailsTable = new JTable(getDetailsTableModel()) {
// Handle Escape key events here
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE && getCellEditor() == null) {
// We are not editing, forward to filechooser.
*** 1445,1454 ****
--- 1454,1464 ----
cancelEdit();
}
protected Action newFolderAction;
+ @SuppressWarnings("serial") // anonymous class inside
public Action getNewFolderAction() {
if (!readOnly && newFolderAction == null) {
newFolderAction = new AbstractAction(newFolderActionLabelText) {
private Action basicNewFolderAction;
*** 1477,1486 ****
--- 1487,1497 ----
};
}
return newFolderAction;
}
+ @SuppressWarnings("serial") // JDK-implementation class
protected class FileRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected,
boolean cellHasFocus) {