3909N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <code>JFileChooser</code> provides a simple mechanism for the user to 0N/A * For information about using <code>JFileChooser</code>, see 0N/A * a section in <em>The Java Tutorial</em>. 0N/A * The following code pops up a file chooser for the user's home directory that 0N/A * sees only .jpg and .gif images: 0N/A * JFileChooser chooser = new JFileChooser(); 0N/A * FileNameExtensionFilter filter = new FileNameExtensionFilter( 0N/A * "JPG & GIF Images", "jpg", "gif"); 0N/A * chooser.setFileFilter(filter); 0N/A * int returnVal = chooser.showOpenDialog(parent); 0N/A * if(returnVal == JFileChooser.APPROVE_OPTION) { 0N/A * System.out.println("You chose to open this file: " + 0N/A * chooser.getSelectedFile().getName()); 0N/A * <strong>Warning:</strong> Swing is not thread safe. For more 0N/A * information see <a 0N/A * attribute: isContainer false 0N/A * description: A component which allows for the interactive selection of a file. 0N/A * @author Jeff Dinkins 0N/A * @see #getUIClassID 0N/A // ************************ 0N/A // ***** Dialog Types ***** 0N/A // ************************ 0N/A * Type value indicating that the <code>JFileChooser</code> supports an 0N/A * "Open" file operation. 0N/A * Type value indicating that the <code>JFileChooser</code> supports a 0N/A * "Save" file operation. 0N/A * Type value indicating that the <code>JFileChooser</code> supports a 0N/A * developer-specified file operation. 0N/A // ******************************** 0N/A // ***** Dialog Return Values ***** 0N/A // ******************************** 0N/A * Return value if cancel is chosen. 0N/A * Return value if approve (yes, ok) is chosen. 0N/A * Return value if an error occured. 0N/A // ********************************** 0N/A // ***** JFileChooser properties ***** 0N/A // ********************************** 0N/A /** Instruction to display only files. */ 0N/A /** Instruction to display only directories. */ 0N/A /** Instruction to display both files and directories. */ 0N/A /** Instruction to cancel the current selection. */ 0N/A * Instruction to approve the current selection 0N/A * (same as pressing yes or ok). 0N/A /** Identifies change in the text on the approve (yes, ok) button. */ 0N/A * Identifies change in the tooltip text for the approve (yes, ok) 0N/A /** Identifies change in the mnemonic for the approve (yes, ok) button. */ 0N/A /** Instruction to display the control buttons. */ 0N/A /** Identifies user's directory change. */ 0N/A /** Identifies change in user's single-file selection. */ 0N/A /** Identifies change in user's multiple-file selection. */ 0N/A /** Enables multiple-file selections. */ 0N/A * Says that a different object is being used to find available drives 0N/A * Says that a different object is being used to retrieve file 0N/A /** Identifies a change in the display-hidden-files property. */ 0N/A /** User changed the kind of files to display. */ 0N/A * Identifies a change in the kind of selection (single, 0N/A * Says that a different accessory component is in use 0N/A * (for example, to preview files). 0N/A * Identifies whether a the AcceptAllFileFilter is used or not. 0N/A /** Identifies a change in the dialog title. */ 0N/A * Identifies a change in the type of files displayed (files only, 0N/A * directories only, or both files and directories). 0N/A * Identifies a change in the list of predefined file filters 0N/A * the user can choose from. 0N/A // ****************************** 0N/A // ***** instance variables ***** 0N/A // ****************************** 0N/A // Listens to changes in the native setting for showing hidden files. 0N/A // The Listener is removed and the native setting is ignored if 0N/A // setFileHidingEnabled() is ever called. 0N/A // ************************************* 0N/A // ***** JFileChooser Constructors ***** 0N/A // ************************************* 0N/A * Constructs a <code>JFileChooser</code> pointing to the user's 0N/A * default directory. This default depends on the operating system. 0N/A * It is typically the "My Documents" folder on Windows, and the 0N/A * user's home directory on Unix. 0N/A * Constructs a <code>JFileChooser</code> using the given path. 0N/A * Passing in a <code>null</code> 0N/A * string causes the file chooser to point to the user's default directory. 0N/A * This default depends on the operating system. It is 0N/A * typically the "My Documents" folder on Windows, and the user's 0N/A * home directory on Unix. 0N/A * @param currentDirectoryPath a <code>String</code> giving the path 0N/A * to a file or directory 0N/A * Constructs a <code>JFileChooser</code> using the given <code>File</code> 0N/A * as the path. Passing in a <code>null</code> file 0N/A * causes the file chooser to point to the user's default directory. 0N/A * This default depends on the operating system. It is 0N/A * typically the "My Documents" folder on Windows, and the user's 0N/A * home directory on Unix. 0N/A * @param currentDirectory a <code>File</code> object specifying 0N/A * the path to a file or directory 0N/A * Constructs a <code>JFileChooser</code> using the given 0N/A * <code>FileSystemView</code>. 0N/A * Constructs a <code>JFileChooser</code> using the given current directory 0N/A * and <code>FileSystemView</code>. 0N/A * Constructs a <code>JFileChooser</code> using the given current directory 0N/A * path and <code>FileSystemView</code>. 0N/A * Performs common constructor initialization and setup. 0N/A // Track native setting for showing hidden files 0N/A * Sets the <code>dragEnabled</code> property, 0N/A * which must be <code>true</code> to enable 0N/A * automatic drag handling (the first part of drag and drop) 0N/A * on this component. 0N/A * The <code>transferHandler</code> property needs to be set 0N/A * to a non-<code>null</code> value for the drag to do 0N/A * anything. The default value of the <code>dragEnabled</code> 0N/A * is <code>false</code>. 0N/A * When automatic drag handling is enabled, 0N/A * most look and feels begin a drag-and-drop operation 0N/A * whenever the user presses the mouse button over an item 0N/A * and then moves the mouse a few pixels. 0N/A * Setting this property to <code>true</code> 0N/A * can therefore have a subtle effect on 0N/A * how selections behave. 0N/A * Some look and feels might not support automatic drag and drop; 0N/A * they will ignore this property. You can work around such 0N/A * look and feels by modifying the component 0N/A * to directly call the <code>exportAsDrag</code> method of a 0N/A * <code>TransferHandler</code>. 0N/A * @param b the value to set the <code>dragEnabled</code> property to 0N/A * @exception HeadlessException if 0N/A * <code>b</code> is <code>true</code> and 0N/A * <code>GraphicsEnvironment.isHeadless()</code> 0N/A * returns <code>true</code> 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see #getDragEnabled 0N/A * @see #setTransferHandler 0N/A * @see TransferHandler 0N/A * description: determines whether automatic drag handling is enabled 0N/A * Gets the value of the <code>dragEnabled</code> property. 0N/A * @return the value of the <code>dragEnabled</code> property 0N/A * @see #setDragEnabled 0N/A // ***************************** 0N/A // ****** File Operations ****** 0N/A // ***************************** 0N/A * Returns the selected file. This can be set either by the 0N/A * programmer via <code>setSelectedFile</code> or by a user action, such as 0N/A * either typing the filename into the UI or selecting the 0N/A * file from a list in the UI. 0N/A * @see #setSelectedFile 0N/A * @return the selected file 0N/A * Sets the selected file. If the file's parent directory is 0N/A * not the current directory, changes the current directory 0N/A * to be the file's parent directory. 0N/A * @see #getSelectedFile 0N/A * @param file the selected file 0N/A * Returns a list of selected files if the file chooser is 0N/A * set to allow multiple selection. 0N/A * Sets the list of selected files if the file chooser is 0N/A * set to allow multiple selection. 0N/A * description: The list of selected files if the chooser is in multiple selection mode. 0N/A * Returns the current directory. 0N/A * @return the current directory 0N/A * @see #setCurrentDirectory 0N/A * Sets the current directory. Passing in <code>null</code> sets the 0N/A * file chooser to point to the user's default directory. 0N/A * This default depends on the operating system. It is 0N/A * typically the "My Documents" folder on Windows, and the user's 0N/A * home directory on Unix. 0N/A * If the file passed in as <code>currentDirectory</code> is not a 0N/A * directory, the parent of the file will be used as the currentDirectory. 0N/A * If the parent is not traversable, then it will walk up the parent tree 0N/A * until it finds a traversable directory, or hits the root of the 0N/A * description: The directory that the JFileChooser is showing files of. 0N/A * @param dir the current directory to point to 0N/A * @see #getCurrentDirectory 0N/A /* Verify the toString of object */ 0N/A * Changes the directory to be set to the parent of the 0N/A * current directory. 0N/A * @see #getCurrentDirectory 0N/A * Tells the UI to rescan its files list from the current directory. 0N/A * Makes sure that the specified file is viewable, and 0N/A * @param f a File object 0N/A // ************************************** 0N/A // ***** JFileChooser Dialog methods ***** 0N/A // ************************************** 0N/A * Pops up an "Open File" file chooser dialog. Note that the 0N/A * text that appears in the approve button is determined by 0N/A * @param parent the parent component of the dialog, 0N/A * can be <code>null</code>; 0N/A * see <code>showDialog</code> for details 0N/A * @return the return state of the file chooser on popdown: 0N/A * <li>JFileChooser.CANCEL_OPTION 0N/A * <li>JFileChooser.APPROVE_OPTION 0N/A * <li>JFileChooser.ERROR_OPTION if an error occurs or the 0N/A * dialog is dismissed 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Pops up a "Save File" file chooser dialog. Note that the 0N/A * text that appears in the approve button is determined by 0N/A * @param parent the parent component of the dialog, 0N/A * can be <code>null</code>; 0N/A * see <code>showDialog</code> for details 0N/A * @return the return state of the file chooser on popdown: 0N/A * <li>JFileChooser.CANCEL_OPTION 0N/A * <li>JFileChooser.APPROVE_OPTION 0N/A * <li>JFileChooser.ERROR_OPTION if an error occurs or the 0N/A * dialog is dismissed 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Pops a custom file chooser dialog with a custom approve button. 0N/A * For example, the following code 0N/A * pops up a file chooser with a "Run Application" button 0N/A * (instead of the normal "Save" or "Open" button): 0N/A * filechooser.showDialog(parentFrame, "Run Application"); 0N/A * Alternatively, the following code does the same thing: 0N/A * JFileChooser chooser = new JFileChooser(null); 0N/A * chooser.setApproveButtonText("Run Application"); 0N/A * chooser.showDialog(parentFrame, null); 0N/A * <!--PENDING(jeff) - the following method should be added to the api: 0N/A * showDialog(Component parent);--> 0N/A * <!--PENDING(kwalrath) - should specify modality and what 0N/A * "depends" means.--> 0N/A * The <code>parent</code> argument determines two things: 0N/A * the frame on which the open dialog depends and 0N/A * the component whose position the look and feel 0N/A * should consider when placing the dialog. If the parent 0N/A * is a <code>Frame</code> object (such as a <code>JFrame</code>) 0N/A * then the dialog depends on the frame and 0N/A * the look and feel positions the dialog 0N/A * relative to the frame (for example, centered over the frame). 0N/A * If the parent is a component, then the dialog 0N/A * depends on the frame containing the component, 0N/A * and is positioned relative to the component 0N/A * (for example, centered over the component). 0N/A * If the parent is <code>null</code>, then the dialog depends on 0N/A * no visible window, and it's placed in a 0N/A * look-and-feel-dependent position 0N/A * such as the center of the screen. 0N/A * @param parent the parent component of the dialog; 0N/A * can be <code>null</code> 0N/A * @param approveButtonText the text of the <code>ApproveButton</code> 0N/A * @return the return state of the file chooser on popdown: 0N/A * <li>JFileChooser.CANCEL_OPTION 0N/A * <li>JFileChooser.APPROVE_OPTION 1740N/A * <li>JFileChooser.ERROR_OPTION if an error occurs or the 0N/A * dialog is dismissed 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 1740N/A // Prevent to show second instance of dialog if the previous one still exists 1453N/A // Remove all components from dialog. The MetalFileChooserUI.installUI() method (and other LAFs) 1453N/A // registers AWT listener for dialogs and produces memory leaks. It happens when 1453N/A // installUI invoked after the showDialog method. 0N/A * Creates and returns a new <code>JDialog</code> wrapping 0N/A * <code>this</code> centered on the <code>parent</code> 0N/A * in the <code>parent</code>'s frame. 0N/A * This method can be overriden to further manipulate the dialog, 0N/A * to disable resizing, set the location, etc. Example: 0N/A * class MyFileChooser extends JFileChooser { 0N/A * protected JDialog createDialog(Component parent) throws HeadlessException { 0N/A * JDialog dialog = super.createDialog(parent); 0N/A * dialog.setLocation(300, 200); 0N/A * dialog.setResizable(false); 0N/A * @param parent the parent component of the dialog; 0N/A * can be <code>null</code> 0N/A * @return a new <code>JDialog</code> containing this instance 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A // ************************** 0N/A // ***** Dialog Options ***** 0N/A // ************************** 0N/A * Returns the value of the <code>controlButtonsAreShown</code> 0N/A * @return the value of the <code>controlButtonsAreShown</code> 0N/A * @see #setControlButtonsAreShown 0N/A * that indicates whether the <i>approve</i> and <i>cancel</i> 0N/A * buttons are shown in the file chooser. This property 0N/A * is <code>true</code> by default. Look and feels 0N/A * that always show these buttons will ignore the value 0N/A * This method fires a property-changed event, 0N/A * using the string value of 0N/A * <code>CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY</code> 0N/A * as the name of the property. 0N/A * @param b <code>false</code> if control buttons should not be 0N/A * shown; otherwise, <code>true</code> 0N/A * description: Sets whether the approve & cancel buttons are shown. 0N/A * @see #getControlButtonsAreShown 0N/A * @see #CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY 0N/A * Returns the type of this dialog. The default is 0N/A * <code>JFileChooser.OPEN_DIALOG</code>. 0N/A * @return the type of dialog to be displayed: 0N/A * <li>JFileChooser.OPEN_DIALOG 0N/A * <li>JFileChooser.SAVE_DIALOG 0N/A * <li>JFileChooser.CUSTOM_DIALOG 0N/A * @see #setDialogType 0N/A * Sets the type of this dialog. Use <code>OPEN_DIALOG</code> when you 0N/A * want to bring up a file chooser that the user can use to open a file. 0N/A * Likewise, use <code>SAVE_DIALOG</code> for letting the user choose 0N/A * a file for saving. 0N/A * Use <code>CUSTOM_DIALOG</code> when you want to use the file 0N/A * chooser in a context other than "Open" or "Save". 0N/A * For instance, you might want to bring up a file chooser that allows 0N/A * the user to choose a file to execute. Note that you normally would not 0N/A * need to set the <code>JFileChooser</code> to use 0N/A * <code>CUSTOM_DIALOG</code> 0N/A * since a call to <code>setApproveButtonText</code> does this for you. 0N/A * The default dialog type is <code>JFileChooser.OPEN_DIALOG</code>. 0N/A * @param dialogType the type of dialog to be displayed: 0N/A * <li>JFileChooser.OPEN_DIALOG 0N/A * <li>JFileChooser.SAVE_DIALOG 0N/A * <li>JFileChooser.CUSTOM_DIALOG 0N/A * @exception IllegalArgumentException if <code>dialogType</code> is 0N/A * description: The type (open, save, custom) of the JFileChooser. 0N/A * OPEN_DIALOG JFileChooser.OPEN_DIALOG 0N/A * SAVE_DIALOG JFileChooser.SAVE_DIALOG 0N/A * CUSTOM_DIALOG JFileChooser.CUSTOM_DIALOG 0N/A * @see #getDialogType 0N/A * @see #setApproveButtonText 0N/A // PENDING(jeff) - fire button text change property 0N/A * Sets the string that goes in the <code>JFileChooser</code> window's 0N/A * @param dialogTitle the new <code>String</code> for the title bar 0N/A * description: The title of the JFileChooser dialog window. 0N/A * @see #getDialogTitle 0N/A * Gets the string that goes in the <code>JFileChooser</code>'s titlebar. 0N/A * @see #setDialogTitle 0N/A // ************************************ 0N/A // ***** JFileChooser View Options ***** 0N/A // ************************************ 0N/A * Sets the tooltip text used in the <code>ApproveButton</code>. 0N/A * If <code>null</code>, the UI object will determine the button's text. 0N/A * description: The tooltip text for the ApproveButton. 0N/A * @param toolTipText the tooltip text for the approve button 0N/A * @see #setApproveButtonText 0N/A * @see #setDialogType 0N/A * Returns the tooltip text used in the <code>ApproveButton</code>. 0N/A * If <code>null</code>, the UI object will determine the button's text. 0N/A * @return the tooltip text used for the approve button 0N/A * @see #setApproveButtonText 0N/A * @see #setDialogType 0N/A * Returns the approve button's mnemonic. 0N/A * @return an integer value for the mnemonic key 0N/A * @see #setApproveButtonMnemonic 0N/A * Sets the approve button's mnemonic using a numeric keycode. 0N/A * @param mnemonic an integer value for the mnemonic key 0N/A * description: The mnemonic key accelerator for the ApproveButton. 0N/A * @see #getApproveButtonMnemonic 0N/A * Sets the approve button's mnemonic using a character. 0N/A * @param mnemonic a character value for the mnemonic key 0N/A * @see #getApproveButtonMnemonic 0N/A * Sets the text used in the <code>ApproveButton</code> in the 0N/A * <code>FileChooserUI</code>. 0N/A * description: The text that goes in the ApproveButton. 0N/A * @param approveButtonText the text used in the <code>ApproveButton</code> 0N/A * @see #getApproveButtonText 0N/A * @see #setDialogType 0N/A // PENDING(jeff) - have ui set this on dialog type change 0N/A * Returns the text used in the <code>ApproveButton</code> in the 0N/A * <code>FileChooserUI</code>. 0N/A * If <code>null</code>, the UI object will determine the button's text. 0N/A * Typically, this would be "Open" or "Save". 0N/A * @return the text used in the <code>ApproveButton</code> 0N/A * @see #setApproveButtonText 0N/A * @see #setDialogType 0N/A * Gets the list of user choosable file filters. 0N/A * @return a <code>FileFilter</code> array containing all the choosable 0N/A * @see #addChoosableFileFilter 0N/A * @see #removeChoosableFileFilter 0N/A * @see #resetChoosableFileFilters 0N/A * Adds a filter to the list of user choosable file filters. 0N/A * For information on setting the file selection mode, see 0N/A * {@link #setFileSelectionMode setFileSelectionMode}. 0N/A * @param filter the <code>FileFilter</code> to add to the choosable file 0N/A * description: Adds a filter to the list of user choosable file filters. 0N/A * @see #getChoosableFileFilters 0N/A * @see #removeChoosableFileFilter 0N/A * @see #resetChoosableFileFilters 0N/A * @see #setFileSelectionMode 0N/A * Removes a filter from the list of user choosable file filters. Returns 0N/A * true if the file filter was removed. 0N/A * @see #addChoosableFileFilter 0N/A * @see #getChoosableFileFilters 0N/A * @see #resetChoosableFileFilters 0N/A * Resets the choosable file filter list to its starting state. Normally, 0N/A * this removes all added file filters while leaving the 0N/A * <code>AcceptAll</code> file filter. 0N/A * @see #addChoosableFileFilter 0N/A * @see #getChoosableFileFilters 0N/A * @see #removeChoosableFileFilter 0N/A * Returns the <code>AcceptAll</code> file filter. 0N/A * For example, on Microsoft Windows this would be All Files (*.*). 0N/A * Returns whether the <code>AcceptAll FileFilter</code> is used. 0N/A * @return true if the <code>AcceptAll FileFilter</code> is used 0N/A * @see #setAcceptAllFileFilterUsed 0N/A * Determines whether the <code>AcceptAll FileFilter</code> is used 0N/A * as an available choice in the choosable filter list. 0N/A * If false, the <code>AcceptAll</code> file filter is removed from 0N/A * the list of available file filters. 0N/A * If true, the <code>AcceptAll</code> file filter will become the 0N/A * the actively used file filter. 0N/A * description: Sets whether the AcceptAll FileFilter is used as an available choice in the choosable filter list. 0N/A * @see #isAcceptAllFileFilterUsed 0N/A * @see #getAcceptAllFileFilter 0N/A * @see #setFileFilter 0N/A * Returns the accessory component. 0N/A * @return this JFileChooser's accessory component, or null 0N/A * @see #setAccessory 0N/A * Sets the accessory component. An accessory is often used to show a 0N/A * preview image of the selected file; however, it can be used for anything 0N/A * that the programmer wishes, such as extra custom file chooser controls. 0N/A * Note: if there was a previous accessory, you should unregister 0N/A * any listeners that the accessory might have registered with the 0N/A * description: Sets the accessory component on the JFileChooser. 0N/A * Sets the <code>JFileChooser</code> to allow the user to just 0N/A * select files, just select 0N/A * directories, or select both files and directories. The default is 0N/A * <code>JFilesChooser.FILES_ONLY</code>. 0N/A * @param mode the type of files to be displayed: 0N/A * <li>JFileChooser.FILES_ONLY 0N/A * <li>JFileChooser.DIRECTORIES_ONLY 0N/A * <li>JFileChooser.FILES_AND_DIRECTORIES 0N/A * @exception IllegalArgumentException if <code>mode</code> is an 0N/A * illegal file selection mode 0N/A * description: Sets the types of files that the JFileChooser can choose. 0N/A * enum: FILES_ONLY JFileChooser.FILES_ONLY 0N/A * DIRECTORIES_ONLY JFileChooser.DIRECTORIES_ONLY 0N/A * FILES_AND_DIRECTORIES JFileChooser.FILES_AND_DIRECTORIES 0N/A * @see #getFileSelectionMode 0N/A * Returns the current file-selection mode. The default is 0N/A * <code>JFilesChooser.FILES_ONLY</code>. 0N/A * @return the type of files to be displayed, one of the following: 0N/A * <li>JFileChooser.FILES_ONLY 0N/A * <li>JFileChooser.DIRECTORIES_ONLY 0N/A * <li>JFileChooser.FILES_AND_DIRECTORIES 0N/A * @see #setFileSelectionMode 0N/A * Convenience call that determines if files are selectable based on the 0N/A * current file selection mode. 0N/A * @see #setFileSelectionMode 0N/A * @see #getFileSelectionMode 0N/A * Convenience call that determines if directories are selectable based 0N/A * on the current file selection mode. 0N/A * @see #setFileSelectionMode 0N/A * @see #getFileSelectionMode 0N/A * Sets the file chooser to allow multiple file selections. 0N/A * @param b true if multiple files may be selected 0N/A * description: Sets multiple file selection mode. 0N/A * @see #isMultiSelectionEnabled 0N/A * Returns true if multiple files can be selected. 0N/A * @return true if multiple files can be selected 0N/A * @see #setMultiSelectionEnabled 0N/A * Returns true if hidden files are not shown in the file chooser; 0N/A * otherwise, returns false. 0N/A * @return the status of the file hiding property 0N/A * @see #setFileHidingEnabled 0N/A * Sets file hiding on or off. If true, hidden files are not shown 0N/A * in the file chooser. The job of determining which files are 0N/A * shown is done by the <code>FileView</code>. 0N/A * description: Sets file hiding on or off. 0N/A * @param b the boolean value that determines whether file hiding is 0N/A * @see #isFileHidingEnabled 0N/A // Dump showFilesListener since we'll ignore it from now on 0N/A * Sets the current file filter. The file filter is used by the 0N/A * file chooser to filter out files from the user's view. 0N/A * description: Sets the File Filter used to filter out files of type. 0N/A * @param filter the new current file filter to use 0N/A * @see #getFileFilter 0N/A * Returns the currently selected file filter. 0N/A * @return the current file filter 0N/A * @see #setFileFilter 0N/A * @see #addChoosableFileFilter 0N/A * Sets the file view to used to retrieve UI information, such as 0N/A * the icon that represents a file or the type description of a file. 0N/A * description: Sets the File View used to get file type information. 0N/A * Returns the current file view. 0N/A // ****************************** 0N/A // *****FileView delegation ***** 0N/A // ****************************** 0N/A // NOTE: all of the following methods attempt to delegate 0N/A // first to the client set fileView, and if <code>null</code> is returned 0N/A // (or there is now client defined fileView) then calls the 0N/A // UI's default fileView. 0N/A * Returns the filename. 0N/A * @param f the <code>File</code> 0N/A * @return the <code>String</code> containing the filename for 0N/A * @see FileView#getName 0N/A * Returns the file description. 0N/A * @param f the <code>File</code> 0N/A * @return the <code>String</code> containing the file description for 0N/A * @see FileView#getDescription 0N/A * Returns the file type. 0N/A * @param f the <code>File</code> 0N/A * @return the <code>String</code> containing the file type description for 0N/A * @see FileView#getTypeDescription 0N/A * Returns the icon for this file or type of file, depending 0N/A * @param f the <code>File</code> 0N/A * @return the <code>Icon</code> for this file, or type of file 0N/A * @see FileView#getIcon 0N/A * Returns true if the file (directory) can be visited. 0N/A * Returns false if the directory cannot be traversed. 0N/A * @param f the <code>File</code> 0N/A * @see FileView#isTraversable 0N/A * Returns true if the file should be displayed. 0N/A * @param f the <code>File</code> 0N/A * @return true if the file should be displayed, otherwise false 0N/A * @see FileFilter#accept 0N/A * Sets the file system view that the <code>JFileChooser</code> uses for 0N/A * accessing and creating file system resources, such as finding 0N/A * the floppy drive and getting a list of root drives. 0N/A * @param fsv the new <code>FileSystemView</code> 0N/A * description: Sets the FileSytemView used to get filesystem information. 0N/A * @see FileSystemView 0N/A * Returns the file system view. 0N/A * @return the <code>FileSystemView</code> object 0N/A * @see #setFileSystemView 0N/A // ************************** 0N/A // ***** Event Handling ***** 0N/A // ************************** 0N/A * Called by the UI when the user hits the Approve button 0N/A * (labeled "Open" or "Save", by default). This can also be 0N/A * called by the programmer. 0N/A * This method causes an action event to fire 0N/A * with the command string equal to 0N/A * <code>APPROVE_SELECTION</code>. 0N/A * @see #APPROVE_SELECTION 0N/A * Called by the UI when the user chooses the Cancel button. 0N/A * This can also be called by the programmer. 0N/A * This method causes an action event to fire 0N/A * with the command string equal to 0N/A * <code>CANCEL_SELECTION</code>. 0N/A * @see #CANCEL_SELECTION 0N/A * Adds an <code>ActionListener</code> to the file chooser. 0N/A * @param l the listener to be added 0N/A * @see #approveSelection 0N/A * @see #cancelSelection 0N/A * Removes an <code>ActionListener</code> from the file chooser. 0N/A * @param l the listener to be removed 0N/A * @see #addActionListener 0N/A * Returns an array of all the action listeners 0N/A * registered on this file chooser. 0N/A * @return all of this file chooser's <code>ActionListener</code>s 0N/A * array if no action listeners are currently registered 0N/A * @see #addActionListener 0N/A * @see #removeActionListener 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. The event instance 0N/A * is lazily created using the <code>command</code> parameter. 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // Lazily create the event: 0N/A // Our JFileChooser is no longer around, so we no longer need to 0N/A // listen for PropertyChangeEvents. 0N/A // ********************************* 0N/A // ***** Pluggable L&F methods ***** 0N/A // ********************************* 0N/A * Resets the UI property to a value from the current look and feel. 0N/A * @see JComponent#updateUI 0N/A // We were probably deserialized 0N/A * Returns a string that specifies the name of the L&F class 0N/A * that renders this component. 0N/A * @return the string "FileChooserUI" 0N/A * @see JComponent#getUIClassID 0N/A * @see UIDefaults#getUI 0N/A * description: A string that specifies the name of the L&F class. 0N/A * Gets the UI object which implements the L&F for this component. 0N/A * @return the FileChooserUI object that implements the FileChooserUI L&F 0N/A * See <code>readObject</code> and <code>writeObject</code> in 0N/A * <code>JComponent</code> for more 0N/A * information about serialization in Swing. 0N/A * See <code>readObject</code> and <code>writeObject</code> in 0N/A * <code>JComponent</code> for more 0N/A * information about serialization in Swing. 0N/A //The AcceptAllFileFilter is UI specific, it will be reset by 0N/A //updateUI() after deserialization 0N/A //The default FileSystemView is platform specific, it will be 0N/A //reset by updateUI() after deserialization 0N/A * Returns a string representation of this <code>JFileChooser</code>. 0N/A * is intended to be used only for debugging purposes, and the 0N/A * content and format of the returned string may vary between 0N/A * implementations. The returned string may be empty but may not 0N/A * be <code>null</code>. 0N/A * @return a string representation of this <code>JFileChooser</code> 0N/A// Accessibility support 0N/A * Gets the AccessibleContext associated with this JFileChooser. 0N/A * For file choosers, the AccessibleContext takes the form of an 0N/A * AccessibleJFileChooser. 0N/A * A new AccessibleJFileChooser instance is created if necessary. 0N/A * @return an AccessibleJFileChooser that serves as the 0N/A * AccessibleContext of this JFileChooser 0N/A * This class implements accessibility support for the 0N/A * <code>JFileChooser</code> class. It provides an implementation of the 0N/A * Java Accessibility API appropriate to file chooser user-interface 0N/A * Gets the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the 0N/A * @see AccessibleRole 0N/A }
// inner class AccessibleJFileChooser