< prev index next >
src/java.desktop/share/classes/javax/swing/JFileChooser.java
Print this page
@@ -53,13 +53,13 @@
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.lang.ref.WeakReference;
/**
- * <code>JFileChooser</code> provides a simple mechanism for the user to
+ * {@code JFileChooser} provides a simple mechanism for the user to
* choose a file.
- * For information about using <code>JFileChooser</code>, see
+ * For information about using {@code JFileChooser}, see
* <a
href="http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html">How to Use File Choosers</a>,
* a section in <em>The Java Tutorial</em>.
*
* <p>
@@ -102,23 +102,23 @@
// ************************
// ***** Dialog Types *****
// ************************
/**
- * Type value indicating that the <code>JFileChooser</code> supports an
+ * Type value indicating that the {@code JFileChooser} supports an
* "Open" file operation.
*/
public static final int OPEN_DIALOG = 0;
/**
- * Type value indicating that the <code>JFileChooser</code> supports a
+ * Type value indicating that the {@code JFileChooser} supports a
* "Save" file operation.
*/
public static final int SAVE_DIALOG = 1;
/**
- * Type value indicating that the <code>JFileChooser</code> supports a
+ * Type value indicating that the {@code JFileChooser} supports a
* developer-specified file operation.
*/
public static final int CUSTOM_DIALOG = 2;
@@ -288,63 +288,63 @@
// *************************************
// ***** JFileChooser Constructors *****
// *************************************
/**
- * Constructs a <code>JFileChooser</code> pointing to the user's
+ * Constructs a {@code JFileChooser} pointing to the user's
* default directory. This default depends on the operating system.
* It is typically the "My Documents" folder on Windows, and the
* user's home directory on Unix.
*/
public JFileChooser() {
this((File) null, (FileSystemView) null);
}
/**
- * Constructs a <code>JFileChooser</code> using the given path.
- * Passing in a <code>null</code>
+ * Constructs a {@code JFileChooser} using the given path.
+ * Passing in a {@code null}
* string causes the file chooser to point to the user's default directory.
* This default depends on the operating system. It is
* typically the "My Documents" folder on Windows, and the user's
* home directory on Unix.
*
- * @param currentDirectoryPath a <code>String</code> giving the path
+ * @param currentDirectoryPath a {@code String} giving the path
* to a file or directory
*/
public JFileChooser(String currentDirectoryPath) {
this(currentDirectoryPath, (FileSystemView) null);
}
/**
- * Constructs a <code>JFileChooser</code> using the given <code>File</code>
- * as the path. Passing in a <code>null</code> file
+ * Constructs a {@code JFileChooser} using the given {@code File}
+ * as the path. Passing in a {@code null} file
* causes the file chooser to point to the user's default directory.
* This default depends on the operating system. It is
* typically the "My Documents" folder on Windows, and the user's
* home directory on Unix.
*
- * @param currentDirectory a <code>File</code> object specifying
+ * @param currentDirectory a {@code File} object specifying
* the path to a file or directory
*/
public JFileChooser(File currentDirectory) {
this(currentDirectory, (FileSystemView) null);
}
/**
- * Constructs a <code>JFileChooser</code> using the given
- * <code>FileSystemView</code>.
+ * Constructs a {@code JFileChooser} using the given
+ * {@code FileSystemView}.
*
* @param fsv a {@code FileSystemView}
*/
public JFileChooser(FileSystemView fsv) {
this((File) null, fsv);
}
/**
- * Constructs a <code>JFileChooser</code> using the given current directory
- * and <code>FileSystemView</code>.
+ * Constructs a {@code JFileChooser} using the given current directory
+ * and {@code FileSystemView}.
*
* @param currentDirectory a {@code File} object specifying the path to a
* file or directory
* @param fsv a {@code FileSystemView}
*/
@@ -352,12 +352,12 @@
setup(fsv);
setCurrentDirectory(currentDirectory);
}
/**
- * Constructs a <code>JFileChooser</code> using the given current directory
- * path and <code>FileSystemView</code>.
+ * Constructs a {@code JFileChooser} using the given current directory
+ * path and {@code FileSystemView}.
*
* @param currentDirectoryPath a {@code String} specifying the path to a file
* or directory
* @param fsv a {@code FileSystemView}
*/
@@ -416,43 +416,43 @@
tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
}
}
/**
- * Sets the <code>dragEnabled</code> property,
- * which must be <code>true</code> to enable
+ * Sets the {@code dragEnabled} property,
+ * which must be {@code true} to enable
* automatic drag handling (the first part of drag and drop)
* on this component.
- * The <code>transferHandler</code> property needs to be set
- * to a non-<code>null</code> value for the drag to do
- * anything. The default value of the <code>dragEnabled</code>
+ * The {@code transferHandler} property needs to be set
+ * to a non-{@code null} value for the drag to do
+ * anything. The default value of the {@code dragEnabled}
* property
- * is <code>false</code>.
+ * is {@code false}.
*
* <p>
*
* When automatic drag handling is enabled,
* most look and feels begin a drag-and-drop operation
* whenever the user presses the mouse button over an item
* and then moves the mouse a few pixels.
- * Setting this property to <code>true</code>
+ * Setting this property to {@code true}
* can therefore have a subtle effect on
* how selections behave.
*
* <p>
*
* Some look and feels might not support automatic drag and drop;
* they will ignore this property. You can work around such
* look and feels by modifying the component
- * to directly call the <code>exportAsDrag</code> method of a
- * <code>TransferHandler</code>.
+ * to directly call the {@code exportAsDrag} method of a
+ * {@code TransferHandler}.
*
- * @param b the value to set the <code>dragEnabled</code> property to
+ * @param b the value to set the {@code dragEnabled} property to
* @exception HeadlessException if
- * <code>b</code> is <code>true</code> and
- * <code>GraphicsEnvironment.isHeadless()</code>
- * returns <code>true</code>
+ * {@code b} is {@code true} and
+ * {@code GraphicsEnvironment.isHeadless()}
+ * returns {@code true}
* @see java.awt.GraphicsEnvironment#isHeadless
* @see #getDragEnabled
* @see #setTransferHandler
* @see TransferHandler
* @since 1.4
@@ -471,13 +471,13 @@
throw new HeadlessException();
}
}
/**
- * Gets the value of the <code>dragEnabled</code> property.
+ * Gets the value of the {@code dragEnabled} property.
*
- * @return the value of the <code>dragEnabled</code> property
+ * @return the value of the {@code dragEnabled} property
* @see #setDragEnabled
* @since 1.4
*/
public boolean getDragEnabled() {
return dragEnabled;
@@ -487,11 +487,11 @@
// ****** File Operations ******
// *****************************
/**
* Returns the selected file. This can be set either by the
- * programmer via <code>setSelectedFile</code> or by a user action, such as
+ * programmer via {@code setSelectedFile} or by a user action, such as
* either typing the filename into the UI or selecting the
* file from a list in the UI.
*
* @see #setSelectedFile
* @return the selected file
@@ -572,17 +572,17 @@
public File getCurrentDirectory() {
return currentDirectory;
}
/**
- * Sets the current directory. Passing in <code>null</code> sets the
+ * Sets the current directory. Passing in {@code null} sets the
* file chooser to point to the user's default directory.
* This default depends on the operating system. It is
* typically the "My Documents" folder on Windows, and the user's
* home directory on Unix.
*
- * If the file passed in as <code>currentDirectory</code> is not a
+ * If the file passed in as {@code currentDirectory} is not a
* directory, the parent of the file will be used as the currentDirectory.
* If the parent is not traversable, then it will walk up the parent tree
* until it finds a traversable directory, or hits the root of the
* file system.
*
@@ -657,12 +657,12 @@
* Pops up an "Open File" file chooser dialog. Note that the
* text that appears in the approve button is determined by
* the L&F.
*
* @param parent the parent component of the dialog,
- * can be <code>null</code>;
- * see <code>showDialog</code> for details
+ * can be {@code null};
+ * see {@code showDialog} for details
* @return the return state of the file chooser on popdown:
* <ul>
* <li>JFileChooser.CANCEL_OPTION
* <li>JFileChooser.APPROVE_OPTION
* <li>JFileChooser.ERROR_OPTION if an error occurs or the
@@ -682,12 +682,12 @@
* Pops up a "Save File" file chooser dialog. Note that the
* text that appears in the approve button is determined by
* the L&F.
*
* @param parent the parent component of the dialog,
- * can be <code>null</code>;
- * see <code>showDialog</code> for details
+ * can be {@code null};
+ * see {@code showDialog} for details
* @return the return state of the file chooser on popdown:
* <ul>
* <li>JFileChooser.CANCEL_OPTION
* <li>JFileChooser.APPROVE_OPTION
* <li>JFileChooser.ERROR_OPTION if an error occurs or the
@@ -724,30 +724,30 @@
* <!--PENDING(kwalrath) - should specify modality and what
* "depends" means.-->
*
* <p>
*
- * The <code>parent</code> argument determines two things:
+ * The {@code parent} argument determines two things:
* the frame on which the open dialog depends and
* the component whose position the look and feel
* should consider when placing the dialog. If the parent
- * is a <code>Frame</code> object (such as a <code>JFrame</code>)
+ * is a {@code Frame} object (such as a {@code JFrame})
* then the dialog depends on the frame and
* the look and feel positions the dialog
* relative to the frame (for example, centered over the frame).
* If the parent is a component, then the dialog
* depends on the frame containing the component,
* and is positioned relative to the component
* (for example, centered over the component).
- * If the parent is <code>null</code>, then the dialog depends on
+ * If the parent is {@code null}, then the dialog depends on
* no visible window, and it's placed in a
* look-and-feel-dependent position
* such as the center of the screen.
*
* @param parent the parent component of the dialog;
- * can be <code>null</code>
- * @param approveButtonText the text of the <code>ApproveButton</code>
+ * can be {@code null}
+ * @param approveButtonText the text of the {@code ApproveButton}
* @return the return state of the file chooser on popdown:
* <ul>
* <li>JFileChooser.CANCEL_OPTION
* <li>JFileChooser.APPROVE_OPTION
* <li>JFileChooser.ERROR_OPTION if an error occurs or the
@@ -789,13 +789,13 @@
dialog = null;
return returnValue;
}
/**
- * Creates and returns a new <code>JDialog</code> wrapping
- * <code>this</code> centered on the <code>parent</code>
- * in the <code>parent</code>'s frame.
+ * Creates and returns a new {@code JDialog} wrapping
+ * {@code this} centered on the {@code parent}
+ * in the {@code parent}'s frame.
* This method can be overriden to further manipulate the dialog,
* to disable resizing, set the location, etc. Example:
* <pre>
* class MyFileChooser extends JFileChooser {
* protected JDialog createDialog(Component parent) throws HeadlessException {
@@ -806,12 +806,12 @@
* }
* }
* </pre>
*
* @param parent the parent component of the dialog;
- * can be <code>null</code>
- * @return a new <code>JDialog</code> containing this instance
+ * can be {@code null}
+ * @return a new {@code JDialog} containing this instance
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
* returns true.
* @see java.awt.GraphicsEnvironment#isHeadless
* @since 1.4
*/
@@ -850,14 +850,14 @@
// **************************
// ***** Dialog Options *****
// **************************
/**
- * Returns the value of the <code>controlButtonsAreShown</code>
+ * Returns the value of the {@code controlButtonsAreShown}
* property.
*
- * @return the value of the <code>controlButtonsAreShown</code>
+ * @return the value of the {@code controlButtonsAreShown}
* property
*
* @see #setControlButtonsAreShown
* @since 1.3
*/
@@ -868,20 +868,20 @@
/**
* Sets the property
* that indicates whether the <i>approve</i> and <i>cancel</i>
* buttons are shown in the file chooser. This property
- * is <code>true</code> by default. Look and feels
+ * is {@code true} by default. Look and feels
* that always show these buttons will ignore the value
* of this property.
* This method fires a property-changed event,
* using the string value of
- * <code>CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY</code>
+ * {@code CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY}
* as the name of the property.
*
- * @param b <code>false</code> if control buttons should not be
- * shown; otherwise, <code>true</code>
+ * @param b {@code false} if control buttons should not be
+ * shown; otherwise, {@code true}
*
* @beaninfo
* preferred: true
* bound: true
* description: Sets whether the approve & cancel buttons are shown.
@@ -899,11 +899,11 @@
firePropertyChange(CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY, oldValue, controlsShown);
}
/**
* Returns the type of this dialog. The default is
- * <code>JFileChooser.OPEN_DIALOG</code>.
+ * {@code JFileChooser.OPEN_DIALOG}.
*
* @return the type of dialog to be displayed:
* <ul>
* <li>JFileChooser.OPEN_DIALOG
* <li>JFileChooser.SAVE_DIALOG
@@ -915,31 +915,31 @@
public int getDialogType() {
return dialogType;
}
/**
- * Sets the type of this dialog. Use <code>OPEN_DIALOG</code> when you
+ * Sets the type of this dialog. Use {@code OPEN_DIALOG} when you
* want to bring up a file chooser that the user can use to open a file.
- * Likewise, use <code>SAVE_DIALOG</code> for letting the user choose
+ * Likewise, use {@code SAVE_DIALOG} for letting the user choose
* a file for saving.
- * Use <code>CUSTOM_DIALOG</code> when you want to use the file
+ * Use {@code CUSTOM_DIALOG} when you want to use the file
* chooser in a context other than "Open" or "Save".
* For instance, you might want to bring up a file chooser that allows
* the user to choose a file to execute. Note that you normally would not
- * need to set the <code>JFileChooser</code> to use
- * <code>CUSTOM_DIALOG</code>
- * since a call to <code>setApproveButtonText</code> does this for you.
- * The default dialog type is <code>JFileChooser.OPEN_DIALOG</code>.
+ * need to set the {@code JFileChooser} to use
+ * {@code CUSTOM_DIALOG}
+ * since a call to {@code setApproveButtonText} does this for you.
+ * The default dialog type is {@code JFileChooser.OPEN_DIALOG}.
*
* @param dialogType the type of dialog to be displayed:
* <ul>
* <li>JFileChooser.OPEN_DIALOG
* <li>JFileChooser.SAVE_DIALOG
* <li>JFileChooser.CUSTOM_DIALOG
* </ul>
*
- * @exception IllegalArgumentException if <code>dialogType</code> is
+ * @exception IllegalArgumentException if {@code dialogType} is
* not legal
* @beaninfo
* preferred: true
* bound: true
* description: The type (open, save, custom) of the JFileChooser.
@@ -972,14 +972,14 @@
"Incorrect Dialog Type: " + dialogType);
}
}
/**
- * Sets the string that goes in the <code>JFileChooser</code> window's
+ * Sets the string that goes in the {@code JFileChooser} window's
* title bar.
*
- * @param dialogTitle the new <code>String</code> for the title bar
+ * @param dialogTitle the new {@code String} for the title bar
*
* @beaninfo
* preferred: true
* bound: true
* description: The title of the JFileChooser dialog window.
@@ -995,11 +995,11 @@
}
firePropertyChange(DIALOG_TITLE_CHANGED_PROPERTY, oldValue, dialogTitle);
}
/**
- * Gets the string that goes in the <code>JFileChooser</code>'s titlebar.
+ * Gets the string that goes in the {@code JFileChooser}'s titlebar.
*
* @return the string from the {@code JFileChooser} window's title bar
* @see #setDialogTitle
*/
public String getDialogTitle() {
@@ -1011,12 +1011,12 @@
// ************************************
/**
- * Sets the tooltip text used in the <code>ApproveButton</code>.
- * If <code>null</code>, the UI object will determine the button's text.
+ * Sets the tooltip text used in the {@code ApproveButton}.
+ * If {@code null}, the UI object will determine the button's text.
*
* @beaninfo
* preferred: true
* bound: true
* description: The tooltip text for the ApproveButton.
@@ -1035,12 +1035,12 @@
firePropertyChange(APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY, oldValue, approveButtonToolTipText);
}
/**
- * Returns the tooltip text used in the <code>ApproveButton</code>.
- * If <code>null</code>, the UI object will determine the button's text.
+ * Returns the tooltip text used in the {@code ApproveButton}.
+ * If {@code null}, the UI object will determine the button's text.
*
* @return the tooltip text used for the approve button
*
* @see #setApproveButtonText
* @see #setDialogType
@@ -1095,19 +1095,19 @@
setApproveButtonMnemonic(vk);
}
/**
- * Sets the text used in the <code>ApproveButton</code> in the
- * <code>FileChooserUI</code>.
+ * Sets the text used in the {@code ApproveButton} in the
+ * {@code FileChooserUI}.
*
* @beaninfo
* preferred: true
* bound: true
* description: The text that goes in the ApproveButton.
*
- * @param approveButtonText the text used in the <code>ApproveButton</code>
+ * @param approveButtonText the text used in the {@code ApproveButton}
*
* @see #getApproveButtonText
* @see #setDialogType
* @see #showDialog
*/
@@ -1120,17 +1120,17 @@
this.approveButtonText = approveButtonText;
firePropertyChange(APPROVE_BUTTON_TEXT_CHANGED_PROPERTY, oldValue, approveButtonText);
}
/**
- * Returns the text used in the <code>ApproveButton</code> in the
- * <code>FileChooserUI</code>.
- * If <code>null</code>, the UI object will determine the button's text.
+ * Returns the text used in the {@code ApproveButton} in the
+ * {@code FileChooserUI}.
+ * If {@code null}, the UI object will determine the button's text.
*
* Typically, this would be "Open" or "Save".
*
- * @return the text used in the <code>ApproveButton</code>
+ * @return the text used in the {@code ApproveButton}
*
* @see #setApproveButtonText
* @see #setDialogType
* @see #showDialog
*/
@@ -1139,11 +1139,11 @@
}
/**
* Gets the list of user choosable file filters.
*
- * @return a <code>FileFilter</code> array containing all the choosable
+ * @return a {@code FileFilter} array containing all the choosable
* file filters
*
* @see #addChoosableFileFilter
* @see #removeChoosableFileFilter
* @see #resetChoosableFileFilters
@@ -1157,11 +1157,11 @@
/**
* Adds a filter to the list of user choosable file filters.
* For information on setting the file selection mode, see
* {@link #setFileSelectionMode setFileSelectionMode}.
*
- * @param filter the <code>FileFilter</code> to add to the choosable file
+ * @param filter the {@code FileFilter} to add to the choosable file
* filter list
*
* @beaninfo
* preferred: true
* bound: true
@@ -1225,11 +1225,11 @@
}
/**
* Resets the choosable file filter list to its starting state. Normally,
* this removes all added file filters while leaving the
- * <code>AcceptAll</code> file filter.
+ * {@code AcceptAll} file filter.
*
* @see #addChoosableFileFilter
* @see #getChoosableFileFilters
* @see #removeChoosableFileFilter
*/
@@ -1242,11 +1242,11 @@
}
firePropertyChange(CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, oldValue, getChoosableFileFilters());
}
/**
- * Returns the <code>AcceptAll</code> file filter.
+ * Returns the {@code AcceptAll} file filter.
* For example, on Microsoft Windows this would be All Files (*.*).
*
* @return the {@code AcceptAll} file filter
*/
public FileFilter getAcceptAllFileFilter() {
@@ -1256,25 +1256,25 @@
}
return filter;
}
/**
- * Returns whether the <code>AcceptAll FileFilter</code> is used.
- * @return true if the <code>AcceptAll FileFilter</code> is used
+ * Returns whether the {@code AcceptAll FileFilter} is used.
+ * @return true if the {@code AcceptAll FileFilter} is used
* @see #setAcceptAllFileFilterUsed
* @since 1.3
*/
public boolean isAcceptAllFileFilterUsed() {
return useAcceptAllFileFilter;
}
/**
- * Determines whether the <code>AcceptAll FileFilter</code> is used
+ * Determines whether the {@code AcceptAll FileFilter} is used
* as an available choice in the choosable filter list.
- * If false, the <code>AcceptAll</code> file filter is removed from
+ * If false, the {@code AcceptAll} file filter is removed from
* the list of available file filters.
- * If true, the <code>AcceptAll</code> file filter will become the
+ * If true, the {@code AcceptAll} file filter will become the
* actively used file filter.
*
* @param b a {@code boolean} which determines whether the {@code AcceptAll}
* file filter is an available choice in the choosable filter list
* @beaninfo
@@ -1330,23 +1330,23 @@
accessory = newAccessory;
firePropertyChange(ACCESSORY_CHANGED_PROPERTY, oldValue, accessory);
}
/**
- * Sets the <code>JFileChooser</code> to allow the user to just
+ * Sets the {@code JFileChooser} to allow the user to just
* select files, just select
* directories, or select both files and directories. The default is
- * <code>JFilesChooser.FILES_ONLY</code>.
+ * {@code JFilesChooser.FILES_ONLY}.
*
* @param mode the type of files to be displayed:
* <ul>
* <li>JFileChooser.FILES_ONLY
* <li>JFileChooser.DIRECTORIES_ONLY
* <li>JFileChooser.FILES_AND_DIRECTORIES
* </ul>
*
- * @exception IllegalArgumentException if <code>mode</code> is an
+ * @exception IllegalArgumentException if {@code mode} is an
* illegal file selection mode
* @beaninfo
* preferred: true
* bound: true
* description: Sets the types of files that the JFileChooser can choose.
@@ -1376,11 +1376,11 @@
}
}
/**
* Returns the current file-selection mode. The default is
- * <code>JFilesChooser.FILES_ONLY</code>.
+ * {@code JFilesChooser.FILES_ONLY}.
*
* @return the type of files to be displayed, one of the following:
* <ul>
* <li>JFileChooser.FILES_ONLY
* <li>JFileChooser.DIRECTORIES_ONLY
@@ -1457,11 +1457,11 @@
}
/**
* Sets file hiding on or off. If true, hidden files are not shown
* in the file chooser. The job of determining which files are
- * shown is done by the <code>FileView</code>.
+ * shown is done by the {@code FileView}.
*
* @beaninfo
* preferred: true
* bound: true
* description: Sets file hiding on or off.
@@ -1566,13 +1566,13 @@
// (or there is now client defined fileView) then calls the
// UI's default fileView.
/**
* Returns the filename.
- * @param f the <code>File</code>
- * @return the <code>String</code> containing the filename for
- * <code>f</code>
+ * @param f the {@code File}
+ * @return the {@code String} containing the filename for
+ * {@code f}
* @see FileView#getName
*/
public String getName(File f) {
String filename = null;
if(f != null) {
@@ -1589,13 +1589,13 @@
return filename;
}
/**
* Returns the file description.
- * @param f the <code>File</code>
- * @return the <code>String</code> containing the file description for
- * <code>f</code>
+ * @param f the {@code File}
+ * @return the {@code String} containing the file description for
+ * {@code f}
* @see FileView#getDescription
*/
public String getDescription(File f) {
String description = null;
if(f != null) {
@@ -1612,13 +1612,13 @@
return description;
}
/**
* Returns the file type.
- * @param f the <code>File</code>
- * @return the <code>String</code> containing the file type description for
- * <code>f</code>
+ * @param f the {@code File}
+ * @return the {@code String} containing the file type description for
+ * {@code f}
* @see FileView#getTypeDescription
*/
public String getTypeDescription(File f) {
String typeDescription = null;
if(f != null) {
@@ -1636,12 +1636,12 @@
}
/**
* Returns the icon for this file or type of file, depending
* on the system.
- * @param f the <code>File</code>
- * @return the <code>Icon</code> for this file, or type of file
+ * @param f the {@code File}
+ * @return the {@code Icon} for this file, or type of file
* @see FileView#getIcon
*/
public Icon getIcon(File f) {
Icon icon = null;
if (f != null) {
@@ -1659,11 +1659,11 @@
}
/**
* Returns true if the file (directory) can be visited.
* Returns false if the directory cannot be traversed.
- * @param f the <code>File</code>
+ * @param f the {@code File}
* @return true if the file/directory can be traversed, otherwise false
* @see FileView#isTraversable
*/
public boolean isTraversable(File f) {
Boolean traversable = null;
@@ -1684,11 +1684,11 @@
return (traversable != null && traversable.booleanValue());
}
/**
* Returns true if the file should be displayed.
- * @param f the <code>File</code>
+ * @param f the {@code File}
* @return true if the file should be displayed, otherwise false
* @see FileFilter#accept
*/
public boolean accept(File f) {
boolean shown = true;
@@ -1697,14 +1697,14 @@
}
return shown;
}
/**
- * Sets the file system view that the <code>JFileChooser</code> uses for
+ * Sets the file system view that the {@code JFileChooser} uses for
* accessing and creating file system resources, such as finding
* the floppy drive and getting a list of root drives.
- * @param fsv the new <code>FileSystemView</code>
+ * @param fsv the new {@code FileSystemView}
*
* @beaninfo
* expert: true
* bound: true
* description: Sets the FileSytemView used to get filesystem information.
@@ -1717,11 +1717,11 @@
firePropertyChange(FILE_SYSTEM_VIEW_CHANGED_PROPERTY, oldValue, fileSystemView);
}
/**
* Returns the file system view.
- * @return the <code>FileSystemView</code> object
+ * @return the {@code FileSystemView} object
* @see #setFileSystemView
*/
public FileSystemView getFileSystemView() {
return fileSystemView;
}
@@ -1734,11 +1734,11 @@
* Called by the UI when the user hits the Approve button
* (labeled "Open" or "Save", by default). This can also be
* called by the programmer.
* This method causes an action event to fire
* with the command string equal to
- * <code>APPROVE_SELECTION</code>.
+ * {@code APPROVE_SELECTION}.
*
* @see #APPROVE_SELECTION
*/
public void approveSelection() {
returnValue = APPROVE_OPTION;
@@ -1751,11 +1751,11 @@
/**
* Called by the UI when the user chooses the Cancel button.
* This can also be called by the programmer.
* This method causes an action event to fire
* with the command string equal to
- * <code>CANCEL_SELECTION</code>.
+ * {@code CANCEL_SELECTION}.
*
* @see #CANCEL_SELECTION
*/
public void cancelSelection() {
returnValue = CANCEL_OPTION;
@@ -1764,11 +1764,11 @@
}
fireActionPerformed(CANCEL_SELECTION);
}
/**
- * Adds an <code>ActionListener</code> to the file chooser.
+ * Adds an {@code ActionListener} to the file chooser.
*
* @param l the listener to be added
*
* @see #approveSelection
* @see #cancelSelection
@@ -1776,11 +1776,11 @@
public void addActionListener(ActionListener l) {
listenerList.add(ActionListener.class, l);
}
/**
- * Removes an <code>ActionListener</code> from the file chooser.
+ * Removes an {@code ActionListener} from the file chooser.
*
* @param l the listener to be removed
*
* @see #addActionListener
*/
@@ -1790,11 +1790,11 @@
/**
* Returns an array of all the action listeners
* registered on this file chooser.
*
- * @return all of this file chooser's <code>ActionListener</code>s
+ * @return all of this file chooser's {@code ActionListener}s
* or an empty
* array if no action listeners are currently registered
*
* @see #addActionListener
* @see #removeActionListener
@@ -1806,11 +1806,11 @@
}
/**
* Notifies all listeners that have registered interest for
* notification on this event type. The event instance
- * is lazily created using the <code>command</code> parameter.
+ * is lazily created using the {@code command} parameter.
*
* @param command a string that may specify a command associated with
* the event
* @see EventListenerList
*/
@@ -1911,12 +1911,12 @@
public FileChooserUI getUI() {
return (FileChooserUI) ui;
}
/**
- * See <code>readObject</code> and <code>writeObject</code> in
- * <code>JComponent</code> for more
+ * See {@code readObject} and {@code writeObject} in
+ * {@code JComponent} for more
* information about serialization in Swing.
*/
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
ObjectInputStream.GetField f = in.readFields();
@@ -1958,12 +1958,12 @@
installShowFilesListener();
}
/**
- * See <code>readObject</code> and <code>writeObject</code> in
- * <code>JComponent</code> for more
+ * See {@code readObject} and {@code writeObject} in
+ * {@code JComponent} for more
* information about serialization in Swing.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
FileSystemView fsv = null;
@@ -1994,18 +1994,18 @@
}
}
/**
- * Returns a string representation of this <code>JFileChooser</code>.
+ * Returns a string representation of this {@code JFileChooser}.
* This method
* is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not
- * be <code>null</code>.
+ * be {@code null}.
*
- * @return a string representation of this <code>JFileChooser</code>
+ * @return a string representation of this {@code JFileChooser}
*/
protected String paramString() {
String approveButtonTextString = (approveButtonText != null ?
approveButtonText: "");
String dialogTitleString = (dialogTitle != null ?
@@ -2077,11 +2077,11 @@
return accessibleContext;
}
/**
* This class implements accessibility support for the
- * <code>JFileChooser</code> class. It provides an implementation of the
+ * {@code JFileChooser} class. It provides an implementation of the
* Java Accessibility API appropriate to file chooser user-interface
* elements.
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
protected class AccessibleJFileChooser extends AccessibleJComponent {
< prev index next >