Module java.desktop

Class BasicFileChooserUI

直接已知的子类:
MetalFileChooserUI

public class BasicFileChooserUI extends FileChooserUI
文件选择器的基本外观实现。
  • Field Details

    • directoryIcon

      protected Icon directoryIcon
      目录图标。
    • fileIcon

      protected Icon fileIcon
      文件图标。
    • computerIcon

      protected Icon computerIcon
      计算机图标。
    • hardDriveIcon

      protected Icon hardDriveIcon
      硬盘驱动器图标。
    • floppyDriveIcon

      protected Icon floppyDriveIcon
      软盘驱动器图标。
    • newFolderIcon

      protected Icon newFolderIcon
      新建文件夹图标。
    • upFolderIcon

      protected Icon upFolderIcon
      上级文件夹图标。
    • homeFolderIcon

      protected Icon homeFolderIcon
      主文件夹图标。
    • listViewIcon

      protected Icon listViewIcon
      列表视图图标。
    • detailsViewIcon

      protected Icon detailsViewIcon
      详细视图图标。
    • viewMenuIcon

      protected Icon viewMenuIcon
      视图菜单图标。
    • saveButtonMnemonic

      protected int saveButtonMnemonic
      保存按钮助记键。
    • openButtonMnemonic

      protected int openButtonMnemonic
      打开按钮助记键。
    • cancelButtonMnemonic

      protected int cancelButtonMnemonic
      取消按钮助记键。
    • updateButtonMnemonic

      protected int updateButtonMnemonic
      更新按钮助记键。
    • helpButtonMnemonic

      protected int helpButtonMnemonic
      当选择模式为FILES_ONLY且选择了目录时,用于批准按钮的助记键代码。
    • directoryOpenButtonMnemonic

      protected int directoryOpenButtonMnemonic
      The mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.
      自1.4版本起:
      1.4
    • saveButtonText

      protected String saveButtonText
      保存按钮文本。
    • openButtonText

      protected String openButtonText
      打开按钮文本。
    • cancelButtonText

      protected String cancelButtonText
      取消按钮文本。
    • updateButtonText

      protected String updateButtonText
      更新按钮文本。
    • helpButtonText

      protected String helpButtonText
      帮助按钮文本。
    • directoryOpenButtonText

      protected String directoryOpenButtonText
      当选择模式为FILES_ONLY且选择了目录时,显示在批准按钮上的标签文本。
      自1.4版本起:
      1.4
    • saveButtonToolTipText

      protected String saveButtonToolTipText
      保存按钮工具提示文本。
    • openButtonToolTipText

      protected String openButtonToolTipText
      打开按钮工具提示文本。
    • cancelButtonToolTipText

      protected String cancelButtonToolTipText
      取消按钮工具提示文本。
    • updateButtonToolTipText

      protected String updateButtonToolTipText
      更新按钮工具提示文本。
    • helpButtonToolTipText

      protected String helpButtonToolTipText
      帮助按钮工具提示文本。
    • directoryOpenButtonToolTipText

      protected String directoryOpenButtonToolTipText
      当选择模式为FILES_ONLY且选择了目录时,显示在批准按钮上的工具提示文本。
      自1.4版本起:
      1.4
  • Constructor Details

    • BasicFileChooserUI

      public BasicFileChooserUI(JFileChooser b)
      构造一个BasicFileChooserUI
      参数:
      b - 文件选择器
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent c)
      为指定组件创建BasicFileChooserUI实现。默认情况下,BasicLookAndFeel类使用所有基本UI类的createUI方法来实例化UI。
      参数:
      c - 需要UI的JFileChooser
      返回:
      BasicFileChooserUI对象
      自1.7版本起:
      1.7
      参见:
    • installUI

      public void installUI(JComponent c)
      安装UI。
      覆盖:
      installUI 在类 ComponentUI
      参数:
      c - 组件
      参见:
    • uninstallUI

      public void uninstallUI(JComponent c)
      卸载UI。
      覆盖:
      uninstallUI 在类 ComponentUI
      参数:
      c - 组件
      参见:
    • installComponents

      public void installComponents(JFileChooser fc)
      安装组件。
      参数:
      fc - 文件选择器
    • uninstallComponents

      public void uninstallComponents(JFileChooser fc)
      卸载组件。
      参数:
      fc - 文件选择器
    • installListeners

      protected void installListeners(JFileChooser fc)
      安装监听器。
      参数:
      fc - 文件选择器
    • uninstallListeners

      protected void uninstallListeners(JFileChooser fc)
      卸载监听器。
      参数:
      fc - 文件选择器
    • installDefaults

      protected void installDefaults(JFileChooser fc)
      安装默认值。
      参数:
      fc - 文件选择器
    • installIcons

      protected void installIcons(JFileChooser fc)
      安装图标。
      参数:
      fc - 文件选择器
    • installStrings

      protected void installStrings(JFileChooser fc)
      安装字符串。
      参数:
      fc - 文件选择器
    • uninstallDefaults

      protected void uninstallDefaults(JFileChooser fc)
      卸载默认值。
      参数:
      fc - 文件选择器
    • uninstallIcons

      protected void uninstallIcons(JFileChooser fc)
      卸载图标。
      参数:
      fc - 文件选择器
    • uninstallStrings

      protected void uninstallStrings(JFileChooser fc)
      卸载字符串。
      参数:
      fc - 文件选择器
    • createModel

      protected void createModel()
      创建模型。
    • getModel

      public BasicDirectoryModel getModel()
      返回模型。
      返回:
      模型
    • createPropertyChangeListener

      public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
      创建属性更改监听器。
      参数:
      fc - 文件选择器
      返回:
      属性更改监听器
    • getFileName

      public String getFileName()
      返回文件名。
      返回:
      文件名
    • getDirectoryName

      public String getDirectoryName()
      返回目录名。
      返回:
      目录名
    • setFileName

      public void setFileName(String filename)
      设置文件名。
      参数:
      filename - 文件名
    • setDirectoryName

      public void setDirectoryName(String dirname)
      设置目录名。
      参数:
      dirname - 文件名
    • rescanCurrentDirectory

      public void rescanCurrentDirectory(JFileChooser fc)
      重新扫描当前目录。
      指定者:
      rescanCurrentDirectory 在类 FileChooserUI
      参数:
      fc - 文件选择器
    • ensureFileIsVisible

      public void ensureFileIsVisible(JFileChooser fc, File f)
      确保所讨论的文件可见。
      指定者:
      ensureFileIsVisible 在类 FileChooserUI
      参数:
      fc - 文件选择器
      f - 文件
    • getFileChooser

      public JFileChooser getFileChooser()
      返回文件选择器。
      返回:
      文件选择器
    • getAccessoryPanel

      public JPanel getAccessoryPanel()
      返回附件面板。
      返回:
      附件面板
    • getApproveButton

      protected JButton getApproveButton(JFileChooser fc)
      返回确认按钮。
      参数:
      fc - 文件选择器
      返回:
      确认按钮
    • getApproveButtonToolTipText

      public String getApproveButtonToolTipText(JFileChooser fc)
      返回确认按钮工具提示。
      参数:
      fc - 文件选择器
      返回:
      确认按钮工具提示
    • clearIconCache

      public void clearIconCache()
      清除图标缓存。
    • createDoubleClickListener

      protected MouseListener createDoubleClickListener(JFileChooser fc, JList<?> list)
      创建双击监听器。
      参数:
      fc - 文件选择器
      list - 列表
      返回:
      双击监听器
    • createListSelectionListener

      public ListSelectionListener createListSelectionListener(JFileChooser fc)
      创建列表选择监听器。
      参数:
      fc - 文件选择器
      返回:
      列表选择监听器
    • isDirectorySelected

      protected boolean isDirectorySelected()
      属性,用于记住UI中当前是否选择了目录。
      返回:
      true 如果当前选择了目录。
      自:
      1.4
    • setDirectorySelected

      protected void setDirectorySelected(boolean b)
      属性,用于记住UI中当前是否选择了目录。通常在选择事件中由UI调用。
      参数:
      b - 如果当前选择了目录。
      自:
      1.4
    • getDirectory

      protected File getDirectory()
      属性,用于记住UI中当前选择的目录。
      返回:
      directory 属性的值
      自:
      1.4
      参见:
    • setDirectory

      protected void setDirectory(File f)
      属性,用于记住UI中当前选择的目录。通常在选择事件中由UI调用。
      参数:
      f - 表示当前选择的目录的File对象
      自:
      1.4
    • getAcceptAllFileFilter

      public FileFilter getAcceptAllFileFilter(JFileChooser fc)
      返回默认接受所有文件过滤器
      指定者:
      getAcceptAllFileFilter 在类 FileChooserUI
      参数:
      fc - 文件选择器
      返回:
      一个接受所有文件的过滤器
    • getFileView

      public FileView getFileView(JFileChooser fc)
      从类中复制的描述: FileChooserUI
      返回文件视图。
      指定者:
      getFileView 在类 FileChooserUI
      参数:
      fc - 文件选择器
      返回:
      一个文件视图
    • getDialogTitle

      public String getDialogTitle(JFileChooser fc)
      返回此对话框的标题
      指定者:
      getDialogTitle 在类 FileChooserUI
      参数:
      fc - 文件选择器
      返回:
      此对话框的标题
    • getApproveButtonMnemonic

      public int getApproveButtonMnemonic(JFileChooser fc)
      返回确认按钮助记键。
      参数:
      fc - 文件选择器
      返回:
      确认按钮助记键
    • getApproveButtonText

      public String getApproveButtonText(JFileChooser fc)
      返回确认按钮文本。
      指定者:
      getApproveButtonText 在类 FileChooserUI
      参数:
      fc - 文件选择器
      返回:
      确认按钮文本
    • getNewFolderAction

      public Action getNewFolderAction()
      返回新建文件夹操作。
      返回:
      一个新建文件夹操作
    • getGoHomeAction

      public Action getGoHomeAction()
      返回返回主目录操作。
      返回:
      一个返回主目录操作
    • getChangeToParentDirectoryAction

      public Action getChangeToParentDirectoryAction()
      返回返回父目录操作。
      返回:
      一个返回父目录操作
    • getApproveSelectionAction

      public Action getApproveSelectionAction()
      返回确认选择操作。
      返回:
      一个确认选择操作
    • getCancelSelectionAction

      public Action getCancelSelectionAction()
      返回取消选择操作。
      返回:
      一个取消选择操作
    • getUpdateAction

      public Action getUpdateAction()
      返回更新操作。
      返回:
      一个更新操作