Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicFileChooserUI

extends FileChooserUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.metal.MetalFileChooserUI, com.sun.java.swing.plaf.motif.MotifFileChooserUI, sun.swing.plaf.synth.SynthFileChooserUI
Imports
java.awt.BorderLayout, .Toolkit, java.awt.datatransfer.DataFlavor, .Transferable, java.awt.event.ActionEvent, .MouseAdapter, .MouseEvent, .MouseListener, java.beans.PropertyChangeListener, java.io.File, .FileNotFoundException, .IOException, java.util.ArrayList, .Arrays, .Hashtable, .List, .Locale, java.util.regex.Pattern, .PatternSyntaxException, javax.swing.AbstractAction, .Action, .ActionMap, .Icon, .InputMap, .JButton, .JComponent, .JFileChooser, .JList, .JOptionPane, .JPanel, .JTable, .LookAndFeel, .SwingUtilities, .TransferHandler, .UIDefaults, .UIManager, javax.swing.event.ListSelectionEvent, .ListSelectionListener, javax.swing.filechooser.FileFilter, .FileSystemView, .FileView, javax.swing.plaf.ActionMapUIResource, .ComponentUI, .FileChooserUI, .UIResource, sun.awt.shell.ShellFolder, sun.swing.DefaultLookup, .FilePane, .SwingUtilities2, .UIAction

Basic L&F implementation of a FileChooser.
Author
Jeff Dinkins

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
protected class
BasicFileChooserUI.ApproveSelectionAction

Responds to an Open or Save request

protected class
protected class
BasicFileChooserUI.CancelSelectionAction

Responds to a cancel request.

protected class
BasicFileChooserUI.ChangeToParentDirectoryAction

Change to parent directory action.

protected class
pack-priv static class
BasicFileChooserUI.FileTransferHandler

Data transfer support for the file chooser.

pack-priv static class
protected class
BasicFileChooserUI.GoHomeAction

Acts on the "home" key event or equivalent event.

private class
protected class
protected class
protected class
BasicFileChooserUI.UpdateAction

Rescans the files in the current directory

Field Summary

Modifier and TypeField and Description
private BasicFileChooserUI.AcceptAllFileFilter
private JPanel
private FileFilter
private Action
protected int
cancelButtonMnemonic

Cancel button mnemonic

protected String
cancelButtonText

Cancel button text

protected String
cancelButtonToolTipText

Cancel button tool tip text

private Action
private Action
protected Icon
computerIcon

Computer icon

private static final TransferHandler
protected Icon
detailsViewIcon

Details view icon

private File
private String
protected Icon
directoryIcon

Directory icon

protected int
directoryOpenButtonMnemonic

The mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.

protected String
directoryOpenButtonText

The label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.

protected String
directoryOpenButtonToolTipText

The tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.

private boolean
private JFileChooser
private String
protected Icon
fileIcon

File icon

private BasicFileChooserUI.BasicFileView
protected Icon
floppyDriveIcon

Floppy drive icon

private BasicFileChooserUI.GlobFilter
private Action
private BasicFileChooserUI.Handler
protected Icon
hardDriveIcon

Hard drive icon

protected int
helpButtonMnemonic

Help button mnemonic

protected String
helpButtonText

Help button text

protected String
helpButtonToolTipText

Help button tool tip text

protected Icon
homeFolderIcon

Home folder icon

protected Icon
listViewIcon

List view icon

private BasicDirectoryModel
private Action
private String
private String
protected Icon
newFolderIcon

New folder icon

private String
private String
protected int
openButtonMnemonic

Open button mnemonic

protected String
openButtonText

Open button text

protected String
openButtonToolTipText

Open button tool tip text

private String
openDialogTitleText

Open dialog title text

private PropertyChangeListener
private boolean
protected int
saveButtonMnemonic

Save button mnemonic

protected String
saveButtonText

Save button text

protected String
saveButtonToolTipText

Save button tool tip text

private String
saveDialogTitleText

Save dialog title text

private Action
protected int
updateButtonMnemonic

Update button mnemonic

protected String
updateButtonText

Update button text

protected String
updateButtonToolTipText

Update button tool tip text

protected Icon
upFolderIcon

Up folder icon

private boolean
protected Icon
viewMenuIcon

View menu icon

Constructor Summary

AccessConstructor and Description
public
BasicFileChooserUI(JFileChooser
file chooser
b
)

Constructs a BasicFileChooserUI.

Method Summary

Modifier and TypeMethod and Description
private void
public void
clearIconCache()

Clears the icon cache.

pack-priv ActionMap
protected MouseListener

Returns:

a double click listener
createDoubleClickListener
(JFileChooser
the file chooser
fc
,
JList<?>
the list
list
)

Creates a double click listener.

public ListSelectionListener

Returns:

a list selection listener
createListSelectionListener
(JFileChooser
the file chooser
fc
)

Creates a list selection listener.

protected void
createModel()

Creates the model.

public PropertyChangeListener

Returns:

the property change listener
createPropertyChangeListener
(JFileChooser
the file chooser
fc
)

Creates the property change listener.

public static ComponentUI

Returns:

the BasicFileChooserUI object
createUI
(JComponent
the JFileChooser which needs a UI
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Creates a BasicFileChooserUI implementation for the specified component.
public void
ensureFileIsVisible(JFileChooser
the file chooser
fc
,
File
the file
f
)

Implements abstract javax.swing.plaf.FileChooserUI.ensureFileIsVisible.

Ensure the file in question is visible.
public FileFilter
getAcceptAllFileFilter(JFileChooser
the file chooser
fc
)

Implements abstract javax.swing.plaf.FileChooserUI.getAcceptAllFileFilter.

Returns the default accept all file filter
public JPanel

Returns:

the accessory panel
getAccessoryPanel
()

Returns the accessory panel.

pack-priv ActionMap
protected JButton

Returns:

the approve button
getApproveButton
(JFileChooser
the file chooser
fc
)

Returns the approve button.

public int

Returns:

the approve button mnemonic
getApproveButtonMnemonic
(JFileChooser
the file chooser
fc
)

Returns the approve button mnemonic.

public String
getApproveButtonText(JFileChooser
the file chooser
fc
)

Implements abstract javax.swing.plaf.FileChooserUI.getApproveButtonText.

Returns approve button text.
public String

Returns:

the approve button tool tip
getApproveButtonToolTipText
(JFileChooser
the file chooser
fc
)

Returns the approve button tool tip.

public Action

Returns:

an approve selection action
getApproveSelectionAction
()

Returns an approve selection action.

public Action

Returns:

a cancel selection action
getCancelSelectionAction
()

Returns a cancel selection action.

public Action

Returns:

a change to parent directory action
getChangeToParentDirectoryAction
()

Returns a change to parent directory action.

public JButton
getDefaultButton(JFileChooser
the JFileChooser whose default button is requested
fc
)

Overrides javax.swing.plaf.FileChooserUI.getDefaultButton.

Returns default button for current LookAndFeel.
public String

Returns:

the title of this dialog
getDialogTitle
(JFileChooser
the file chooser
fc
)

Implements abstract javax.swing.plaf.FileChooserUI.getDialogTitle.

Returns the title of this dialog
protected File

Returns:

the value of the directory property
getDirectory
()

Property to remember the directory that is currently selected in the UI.

public String

Returns:

the directory name
getDirectoryName
()

Returns the directory name.

public JFileChooser

Returns:

the file chooser
getFileChooser
()

Returns the file chooser.

public String

Returns:

the file name
getFileName
()

Returns the file name.

public FileView
getFileView(JFileChooser
the file chooser
fc
)

Implements abstract javax.swing.plaf.FileChooserUI.getFileView.

Returns a file view.
public Action

Returns:

a go home action
getGoHomeAction
()

Returns a go home action.

private BasicFileChooserUI.Handler
pack-priv InputMap
getInputMap(int condition)

private int
getMnemonic(String key, Locale l)

Returns the mnemonic for the given key.

public BasicDirectoryModel

Returns:

the model
getModel
()

Returns the model.

public Action

Returns:

a new folder action
getNewFolderAction
()

Returns a new folder action.

public Action

Returns:

an update action
getUpdateAction
()

Returns an update action.

public void
installComponents(JFileChooser
the file chooser
fc
)

Installs the components.

protected void
installDefaults(JFileChooser
the file chooser
fc
)

Installs the defaults.

protected void
installIcons(JFileChooser
the file chooser
fc
)

Installs the icons.

protected void
installListeners(JFileChooser
the file chooser
fc
)

Installs the listeners.

protected void
installStrings(JFileChooser
the file chooser
fc
)

Installs the strings.

public void
installUI(JComponent
the component
c
)

Overrides javax.swing.plaf.ComponentUI.installUI.

Installs the UI.
protected boolean

Returns:

true iff a directory is currently selected.
isDirectorySelected
()

Property to remember whether a directory is currently selected in the UI.

private static boolean
public void
rescanCurrentDirectory(JFileChooser
the file chooser
fc
)

Implements abstract javax.swing.plaf.FileChooserUI.rescanCurrentDirectory.

Rescan the current directory.
private void
protected void
setDirectory(File
the File object representing the directory that is currently selected
f
)

Property to remember the directory that is currently selected in the UI.

public void
setDirectoryName(String
the file name
dirname
)

Sets the directory name.

protected void
setDirectorySelected(boolean
iff a directory is currently selected.
b
)

Property to remember whether a directory is currently selected in the UI.

public void
setFileName(String
the file name
filename
)

Sets the file name.

public void
uninstallComponents(JFileChooser
the file chooser
fc
)

Uninstalls the components.

protected void
uninstallDefaults(JFileChooser
the file chooser
fc
)

Uninstalls the defaults.

protected void
uninstallIcons(JFileChooser
the file chooser
fc
)

Uninstalls the icons.

protected void
uninstallListeners(JFileChooser
the file chooser
fc
)

Uninstalls the listeners.

protected void
uninstallStrings(JFileChooser
the file chooser
fc
)

Uninstalls the strings.

public void
uninstallUI(JComponent
the component
c
)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Uninstalls the UI.