Class BasicFileChooserUI

Direct Known Subclasses:
MetalFileChooserUI

public class BasicFileChooserUI extends FileChooserUI
Basic L&F implementation of a FileChooser.
  • Field Details Link icon

    • directoryIcon Link icon

      protected Icon directoryIcon
      Directory icon
    • fileIcon Link icon

      protected Icon fileIcon
      File icon
    • computerIcon Link icon

      protected Icon computerIcon
      Computer icon
    • hardDriveIcon Link icon

      protected Icon hardDriveIcon
      Hard drive icon
    • floppyDriveIcon Link icon

      protected Icon floppyDriveIcon
      Floppy drive icon
    • newFolderIcon Link icon

      protected Icon newFolderIcon
      New folder icon
    • upFolderIcon Link icon

      protected Icon upFolderIcon
      Up folder icon
    • homeFolderIcon Link icon

      protected Icon homeFolderIcon
      Home folder icon
    • listViewIcon Link icon

      protected Icon listViewIcon
      List view icon
    • detailsViewIcon Link icon

      protected Icon detailsViewIcon
      Details view icon
    • viewMenuIcon Link icon

      protected Icon viewMenuIcon
      View menu icon
    • saveButtonMnemonic Link icon

      protected int saveButtonMnemonic
      Save button mnemonic
    • openButtonMnemonic Link icon

      protected int openButtonMnemonic
      Open button mnemonic
    • cancelButtonMnemonic Link icon

      protected int cancelButtonMnemonic
      Cancel button mnemonic
    • updateButtonMnemonic Link icon

      protected int updateButtonMnemonic
      Update button mnemonic
    • helpButtonMnemonic Link icon

      protected int helpButtonMnemonic
      Help button mnemonic
    • directoryOpenButtonMnemonic Link 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.
      Since:
      1.4
    • saveButtonText Link icon

      protected String saveButtonText
      Save button text
    • openButtonText Link icon

      protected String openButtonText
      Open button text
    • cancelButtonText Link icon

      protected String cancelButtonText
      Cancel button text
    • updateButtonText Link icon

      protected String updateButtonText
      Update button text
    • helpButtonText Link icon

      protected String helpButtonText
      Help button text
    • directoryOpenButtonText Link icon

      protected String directoryOpenButtonText
      The label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.
      Since:
      1.4
    • saveButtonToolTipText Link icon

      protected String saveButtonToolTipText
      Save button tool tip text
    • openButtonToolTipText Link icon

      protected String openButtonToolTipText
      Open button tool tip text
    • cancelButtonToolTipText Link icon

      protected String cancelButtonToolTipText
      Cancel button tool tip text
    • updateButtonToolTipText Link icon

      protected String updateButtonToolTipText
      Update button tool tip text
    • helpButtonToolTipText Link icon

      protected String helpButtonToolTipText
      Help button tool tip text
    • directoryOpenButtonToolTipText Link icon

      protected String directoryOpenButtonToolTipText
      The tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.
      Since:
      1.4
  • Constructor Details Link icon

    • BasicFileChooserUI Link icon

      public BasicFileChooserUI(JFileChooser b)
      Constructs a BasicFileChooserUI.
      Parameters:
      b - file chooser
  • Method Details Link icon

    • createUI Link icon

      public static ComponentUI createUI(JComponent c)
      Creates a BasicFileChooserUI implementation for the specified component. By default the BasicLookAndFeel class uses createUI methods of all basic UIs classes to instantiate UIs.
      Parameters:
      c - the JFileChooser which needs a UI
      Returns:
      the BasicFileChooserUI object
      Since:
      1.7
      See Also:
    • installUI Link icon

      public void installUI(JComponent c)
      Installs the UI.
      Overrides:
      installUI in class ComponentUI
      Parameters:
      c - the component
      See Also:
    • uninstallUI Link icon

      public void uninstallUI(JComponent c)
      Uninstalls the UI.
      Overrides:
      uninstallUI in class ComponentUI
      Parameters:
      c - the component
      See Also:
    • installComponents Link icon

      public void installComponents(JFileChooser fc)
      Installs the components.
      Parameters:
      fc - the file chooser
    • uninstallComponents Link icon

      public void uninstallComponents(JFileChooser fc)
      Uninstalls the components.
      Parameters:
      fc - the file chooser
    • installListeners Link icon

      protected void installListeners(JFileChooser fc)
      Installs the listeners.
      Parameters:
      fc - the file chooser
    • uninstallListeners Link icon

      protected void uninstallListeners(JFileChooser fc)
      Uninstalls the listeners.
      Parameters:
      fc - the file chooser
    • installDefaults Link icon

      protected void installDefaults(JFileChooser fc)
      Installs the defaults.
      Parameters:
      fc - the file chooser
    • installIcons Link icon

      protected void installIcons(JFileChooser fc)
      Installs the icons.
      Parameters:
      fc - the file chooser
    • installStrings Link icon

      protected void installStrings(JFileChooser fc)
      Installs the strings.
      Parameters:
      fc - the file chooser
    • uninstallDefaults Link icon

      protected void uninstallDefaults(JFileChooser fc)
      Uninstalls the defaults.
      Parameters:
      fc - the file chooser
    • uninstallIcons Link icon

      protected void uninstallIcons(JFileChooser fc)
      Uninstalls the icons.
      Parameters:
      fc - the file chooser
    • uninstallStrings Link icon

      protected void uninstallStrings(JFileChooser fc)
      Uninstalls the strings.
      Parameters:
      fc - the file chooser
    • createModel Link icon

      protected void createModel()
      Creates the model.
    • getModel Link icon

      public BasicDirectoryModel getModel()
      Returns the model.
      Returns:
      the model
    • createPropertyChangeListener Link icon

      public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
      Creates the property change listener.
      Parameters:
      fc - the file chooser
      Returns:
      the property change listener
    • getFileName Link icon

      public String getFileName()
      Returns the file name.
      Returns:
      the file name
    • getDirectoryName Link icon

      public String getDirectoryName()
      Returns the directory name.
      Returns:
      the directory name
    • setFileName Link icon

      public void setFileName(String filename)
      Sets the file name.
      Parameters:
      filename - the file name
    • setDirectoryName Link icon

      public void setDirectoryName(String dirname)
      Sets the directory name.
      Parameters:
      dirname - the file name
    • rescanCurrentDirectory Link icon

      public void rescanCurrentDirectory(JFileChooser fc)
      Rescan the current directory.
      Specified by:
      rescanCurrentDirectory in class FileChooserUI
      Parameters:
      fc - the file chooser
    • ensureFileIsVisible Link icon

      public void ensureFileIsVisible(JFileChooser fc, File f)
      Ensure the file in question is visible.
      Specified by:
      ensureFileIsVisible in class FileChooserUI
      Parameters:
      fc - the file chooser
      f - the file
    • getFileChooser Link icon

      public JFileChooser getFileChooser()
      Returns the file chooser.
      Returns:
      the file chooser
    • getAccessoryPanel Link icon

      public JPanel getAccessoryPanel()
      Returns the accessory panel.
      Returns:
      the accessory panel
    • getApproveButton Link icon

      protected JButton getApproveButton(JFileChooser fc)
      Returns the approve button.
      Parameters:
      fc - the file chooser
      Returns:
      the approve button
    • getApproveButtonToolTipText Link icon

      public String getApproveButtonToolTipText(JFileChooser fc)
      Returns the approve button tool tip.
      Parameters:
      fc - the file chooser
      Returns:
      the approve button tool tip
    • clearIconCache Link icon

      public void clearIconCache()
      Clears the icon cache.
    • createDoubleClickListener Link icon

      protected MouseListener createDoubleClickListener(JFileChooser fc, JList<?> list)
      Creates a double click listener.
      Parameters:
      fc - the file chooser
      list - the list
      Returns:
      a double click listener
    • createListSelectionListener Link icon

      public ListSelectionListener createListSelectionListener(JFileChooser fc)
      Creates a list selection listener.
      Parameters:
      fc - the file chooser
      Returns:
      a list selection listener
    • isDirectorySelected Link icon

      protected boolean isDirectorySelected()
      Property to remember whether a directory is currently selected in the UI.
      Returns:
      true iff a directory is currently selected.
      Since:
      1.4
    • setDirectorySelected Link icon

      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.
      Since:
      1.4
    • getDirectory Link icon

      protected File getDirectory()
      Property to remember the directory that is currently selected in the UI.
      Returns:
      the value of the directory property
      Since:
      1.4
      See Also:
    • setDirectory Link icon

      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
      Since:
      1.4
    • getAcceptAllFileFilter Link icon

      public FileFilter getAcceptAllFileFilter(JFileChooser fc)
      Returns the default accept all file filter
      Specified by:
      getAcceptAllFileFilter in class FileChooserUI
      Parameters:
      fc - the file chooser
      Returns:
      an accept-all file filter
    • getFileView Link icon

      public FileView getFileView(JFileChooser fc)
      Description copied from class: FileChooserUI
      Returns a file view.
      Specified by:
      getFileView in class FileChooserUI
      Parameters:
      fc - the file chooser
      Returns:
      a file view
    • getDialogTitle Link icon

      public String getDialogTitle(JFileChooser fc)
      Returns the title of this dialog
      Specified by:
      getDialogTitle in class FileChooserUI
      Parameters:
      fc - the file chooser
      Returns:
      the title of this dialog
    • getApproveButtonMnemonic Link icon

      public int getApproveButtonMnemonic(JFileChooser fc)
      Returns the approve button mnemonic.
      Parameters:
      fc - the file chooser
      Returns:
      the approve button mnemonic
    • getApproveButtonText Link icon

      public String getApproveButtonText(JFileChooser fc)
      Returns approve button text.
      Specified by:
      getApproveButtonText in class FileChooserUI
      Parameters:
      fc - the file chooser
      Returns:
      approve button text.
    • getNewFolderAction Link icon

      public Action getNewFolderAction()
      Returns a new folder action.
      Returns:
      a new folder action
    • getGoHomeAction Link icon

      public Action getGoHomeAction()
      Returns a go home action.
      Returns:
      a go home action
    • getChangeToParentDirectoryAction Link icon

      public Action getChangeToParentDirectoryAction()
      Returns a change to parent directory action.
      Returns:
      a change to parent directory action
    • getApproveSelectionAction Link icon

      public Action getApproveSelectionAction()
      Returns an approve selection action.
      Returns:
      an approve selection action
    • getCancelSelectionAction Link icon

      public Action getCancelSelectionAction()
      Returns a cancel selection action.
      Returns:
      a cancel selection action
    • getUpdateAction Link icon

      public Action getUpdateAction()
      Returns an update action.
      Returns:
      an update action