jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
changeset 23697 e556a715949f
parent 23010 6dadb192ad81
child 24969 afa6934dd8e8
equal deleted inserted replaced
23696:7deff68428ef 23697:e556a715949f
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   750 
   750 
   751 
   751 
   752     /**
   752     /**
   753      * Creates a new folder.
   753      * Creates a new folder.
   754      */
   754      */
       
   755     @SuppressWarnings("serial") // Superclass is not serializable across versions
   755     protected class NewFolderAction extends AbstractAction {
   756     protected class NewFolderAction extends AbstractAction {
   756         protected NewFolderAction() {
   757         protected NewFolderAction() {
   757             super(FilePane.ACTION_NEW_FOLDER);
   758             super(FilePane.ACTION_NEW_FOLDER);
   758         }
   759         }
   759         public void actionPerformed(ActionEvent e) {
   760         public void actionPerformed(ActionEvent e) {
   792     }
   793     }
   793 
   794 
   794     /**
   795     /**
   795      * Acts on the "home" key event or equivalent event.
   796      * Acts on the "home" key event or equivalent event.
   796      */
   797      */
       
   798     @SuppressWarnings("serial") // Superclass is not serializable across versions
   797     protected class GoHomeAction extends AbstractAction {
   799     protected class GoHomeAction extends AbstractAction {
   798         protected GoHomeAction() {
   800         protected GoHomeAction() {
   799             super("Go Home");
   801             super("Go Home");
   800         }
   802         }
   801         public void actionPerformed(ActionEvent e) {
   803         public void actionPerformed(ActionEvent e) {
   802             JFileChooser fc = getFileChooser();
   804             JFileChooser fc = getFileChooser();
   803             changeDirectory(fc.getFileSystemView().getHomeDirectory());
   805             changeDirectory(fc.getFileSystemView().getHomeDirectory());
   804         }
   806         }
   805     }
   807     }
   806 
   808 
       
   809     @SuppressWarnings("serial") // Superclass is not serializable across versions
   807     protected class ChangeToParentDirectoryAction extends AbstractAction {
   810     protected class ChangeToParentDirectoryAction extends AbstractAction {
   808         protected ChangeToParentDirectoryAction() {
   811         protected ChangeToParentDirectoryAction() {
   809             super("Go Up");
   812             super("Go Up");
   810             putValue(Action.ACTION_COMMAND_KEY, FilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY);
   813             putValue(Action.ACTION_COMMAND_KEY, FilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY);
   811         }
   814         }
   815     }
   818     }
   816 
   819 
   817     /**
   820     /**
   818      * Responds to an Open or Save request
   821      * Responds to an Open or Save request
   819      */
   822      */
       
   823     @SuppressWarnings("serial") // Superclass is not serializable across versions
   820     protected class ApproveSelectionAction extends AbstractAction {
   824     protected class ApproveSelectionAction extends AbstractAction {
   821         protected ApproveSelectionAction() {
   825         protected ApproveSelectionAction() {
   822             super(FilePane.ACTION_APPROVE_SELECTION);
   826             super(FilePane.ACTION_APPROVE_SELECTION);
   823         }
   827         }
   824         public void actionPerformed(ActionEvent e) {
   828         public void actionPerformed(ActionEvent e) {
  1123     }
  1127     }
  1124 
  1128 
  1125     /**
  1129     /**
  1126      * Responds to a cancel request.
  1130      * Responds to a cancel request.
  1127      */
  1131      */
       
  1132     @SuppressWarnings("serial") // Superclass is not serializable across versions
  1128     protected class CancelSelectionAction extends AbstractAction {
  1133     protected class CancelSelectionAction extends AbstractAction {
  1129         public void actionPerformed(ActionEvent e) {
  1134         public void actionPerformed(ActionEvent e) {
  1130             getFileChooser().cancelSelection();
  1135             getFileChooser().cancelSelection();
  1131         }
  1136         }
  1132     }
  1137     }
  1133 
  1138 
  1134     /**
  1139     /**
  1135      * Rescans the files in the current directory
  1140      * Rescans the files in the current directory
  1136      */
  1141      */
       
  1142     @SuppressWarnings("serial") // Superclass is not serializable across versions
  1137     protected class UpdateAction extends AbstractAction {
  1143     protected class UpdateAction extends AbstractAction {
  1138         public void actionPerformed(ActionEvent e) {
  1144         public void actionPerformed(ActionEvent e) {
  1139             JFileChooser fc = getFileChooser();
  1145             JFileChooser fc = getFileChooser();
  1140             fc.setCurrentDirectory(fc.getFileSystemView().createFileObject(getDirectoryName()));
  1146             fc.setCurrentDirectory(fc.getFileSystemView().createFileObject(getDirectoryName()));
  1141             fc.rescanCurrentDirectory();
  1147             fc.rescanCurrentDirectory();
  1284 
  1290 
  1285     /**
  1291     /**
  1286      * Data transfer support for the file chooser.  Since files are currently presented
  1292      * Data transfer support for the file chooser.  Since files are currently presented
  1287      * as a list, the list support is reused with the added flavor of DataFlavor.javaFileListFlavor
  1293      * as a list, the list support is reused with the added flavor of DataFlavor.javaFileListFlavor
  1288      */
  1294      */
       
  1295     @SuppressWarnings("serial") // JDK-implementation class
  1289     static class FileTransferHandler extends TransferHandler implements UIResource {
  1296     static class FileTransferHandler extends TransferHandler implements UIResource {
  1290 
  1297 
  1291         /**
  1298         /**
  1292          * Create a Transferable to use as the source for a data transfer.
  1299          * Create a Transferable to use as the source for a data transfer.
  1293          *
  1300          *