public class

BasicFileChooserUI

extends FileChooserUI
java.lang.Object
   ↳ javax.swing.plaf.ComponentUI
     ↳ javax.swing.plaf.FileChooserUI
       ↳ javax.swing.plaf.basic.BasicFileChooserUI
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Basic L&F implementation of a FileChooser.

Summary

Nested Classes
class BasicFileChooserUI.AcceptAllFileFilter  
class BasicFileChooserUI.ApproveSelectionAction Responds to an Open or Save request  
class BasicFileChooserUI.BasicFileView  
class BasicFileChooserUI.CancelSelectionAction Responds to a cancel request. 
class BasicFileChooserUI.ChangeToParentDirectoryAction  
class BasicFileChooserUI.DoubleClickListener  
class BasicFileChooserUI.GoHomeAction Acts on the "home" key event or equivalent event. 
class BasicFileChooserUI.NewFolderAction Creates a new folder. 
class BasicFileChooserUI.SelectionListener  
class BasicFileChooserUI.UpdateAction Rescans the files in the current directory  
Fields
protected int cancelButtonMnemonic
protected String cancelButtonText
protected String cancelButtonToolTipText
protected Icon computerIcon
protected Icon detailsViewIcon
protected Icon directoryIcon
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.
protected Icon fileIcon
protected Icon floppyDriveIcon
protected Icon hardDriveIcon
protected int helpButtonMnemonic
protected String helpButtonText
protected String helpButtonToolTipText
protected Icon homeFolderIcon
protected Icon listViewIcon
protected Icon newFolderIcon
protected int openButtonMnemonic
protected String openButtonText
protected String openButtonToolTipText
protected int saveButtonMnemonic
protected String saveButtonText
protected String saveButtonToolTipText
protected Icon upFolderIcon
protected int updateButtonMnemonic
protected String updateButtonText
protected String updateButtonToolTipText
Public Constructors
BasicFileChooserUI(JFileChooser b)
Public Methods
void clearIconCache()
ListSelectionListener createListSelectionListener(JFileChooser fc)
PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
void ensureFileIsVisible(JFileChooser fc, File f)
FileFilter getAcceptAllFileFilter(JFileChooser fc)
Returns the default accept all file filter
JPanel getAccessoryPanel()
int getApproveButtonMnemonic(JFileChooser fc)
String getApproveButtonText(JFileChooser fc)
String getApproveButtonToolTipText(JFileChooser fc)
Action getApproveSelectionAction()
Action getCancelSelectionAction()
Action getChangeToParentDirectoryAction()
String getDialogTitle(JFileChooser fc)
Returns the title of this dialog
String getDirectoryName()
JFileChooser getFileChooser()
String getFileName()
FileView getFileView(JFileChooser fc)
Action getGoHomeAction()
BasicDirectoryModel getModel()
Action getNewFolderAction()
Action getUpdateAction()
void installComponents(JFileChooser fc)
void installUI(JComponent c)
Configures the specified component appropriate for the look and feel.
void rescanCurrentDirectory(JFileChooser fc)
void setDirectoryName(String dirname)
void setFileName(String filename)
void uninstallComponents(JFileChooser fc)
void uninstallUI(JComponent c)
Reverses configuration which was done on the specified component during installUI.
Protected Methods
MouseListener createDoubleClickListener(JFileChooser fc, JList list)
void createModel()
JButton getApproveButton(JFileChooser fc)
File getDirectory()
Property to remember the directory that is currently selected in the UI.
void installDefaults(JFileChooser fc)
void installIcons(JFileChooser fc)
void installListeners(JFileChooser fc)
void installStrings(JFileChooser fc)
boolean isDirectorySelected()
Property to remember whether a directory is currently selected in the UI.
void setDirectory(File f)
Property to remember the directory that is currently selected in the UI.
void setDirectorySelected(boolean b)
Property to remember whether a directory is currently selected in the UI.
void uninstallDefaults(JFileChooser fc)
void uninstallIcons(JFileChooser fc)
void uninstallListeners(JFileChooser fc)
void uninstallStrings(JFileChooser fc)
[Expand]
Inherited Methods
From class javax.swing.plaf.FileChooserUI
From class javax.swing.plaf.ComponentUI
From class java.lang.Object

Fields

protected int cancelButtonMnemonic

protected String cancelButtonText

protected String cancelButtonToolTipText

protected Icon computerIcon

protected Icon detailsViewIcon

protected Icon directoryIcon

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.

protected Icon fileIcon

protected Icon floppyDriveIcon

protected Icon hardDriveIcon

protected int helpButtonMnemonic

protected String helpButtonText

protected String helpButtonToolTipText

protected Icon homeFolderIcon

protected Icon listViewIcon

protected Icon newFolderIcon

protected int openButtonMnemonic

protected String openButtonText

protected String openButtonToolTipText

protected int saveButtonMnemonic

protected String saveButtonText

protected String saveButtonToolTipText

protected Icon upFolderIcon

protected int updateButtonMnemonic

protected String updateButtonText

protected String updateButtonToolTipText

Public Constructors

public BasicFileChooserUI (JFileChooser b)

Public Methods

public void clearIconCache ()

public ListSelectionListener createListSelectionListener (JFileChooser fc)

public PropertyChangeListener createPropertyChangeListener (JFileChooser fc)

public void ensureFileIsVisible (JFileChooser fc, File f)

public FileFilter getAcceptAllFileFilter (JFileChooser fc)

Returns the default accept all file filter

public JPanel getAccessoryPanel ()

public int getApproveButtonMnemonic (JFileChooser fc)

public String getApproveButtonText (JFileChooser fc)

public String getApproveButtonToolTipText (JFileChooser fc)

public Action getApproveSelectionAction ()

public Action getCancelSelectionAction ()

public Action getChangeToParentDirectoryAction ()

public String getDialogTitle (JFileChooser fc)

Returns the title of this dialog

public String getDirectoryName ()

public JFileChooser getFileChooser ()

public String getFileName ()

public FileView getFileView (JFileChooser fc)

public Action getGoHomeAction ()

public BasicDirectoryModel getModel ()

public Action getNewFolderAction ()

public Action getUpdateAction ()

public void installComponents (JFileChooser fc)

public void installUI (JComponent c)

Configures the specified component appropriate for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:

  1. Install any default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.

Parameters
c the component where this UI delegate is being installed

public void rescanCurrentDirectory (JFileChooser fc)

public void setDirectoryName (String dirname)

public void setFileName (String filename)

public void uninstallComponents (JFileChooser fc)

public void uninstallUI (JComponent c)

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.

Parameters
c the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components

Protected Methods

protected MouseListener createDoubleClickListener (JFileChooser fc, JList list)

protected void createModel ()

protected JButton getApproveButton (JFileChooser fc)

protected File getDirectory ()

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

Returns
  • the value of the directory property

protected void installDefaults (JFileChooser fc)

protected void installIcons (JFileChooser fc)

protected void installListeners (JFileChooser fc)

protected void installStrings (JFileChooser fc)

protected boolean isDirectorySelected ()

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

Returns
  • true iff a directory is currently selected.

protected void setDirectory (File f)

Property to remember the directory that is currently selected in the UI. This is normally called by the UI on a selection event.

Parameters
f the File object representing the directory that is currently selected

protected void setDirectorySelected (boolean b)

Property to remember whether a directory is currently selected in the UI. This is normally called by the UI on a selection event.

Parameters
b iff a directory is currently selected.

protected void uninstallDefaults (JFileChooser fc)

protected void uninstallIcons (JFileChooser fc)

protected void uninstallListeners (JFileChooser fc)

protected void uninstallStrings (JFileChooser fc)