public class BasicFileChooserUI extends FileChooserUI
Modifier and Type | Class and Description |
---|---|
protected class |
BasicFileChooserUI.AcceptAllFileFilter |
protected class |
BasicFileChooserUI.ApproveSelectionAction
响应打开或保存请求
|
protected class |
BasicFileChooserUI.BasicFileView |
protected class |
BasicFileChooserUI.CancelSelectionAction
回复取消请求。
|
protected class |
BasicFileChooserUI.ChangeToParentDirectoryAction |
protected class |
BasicFileChooserUI.DoubleClickListener |
protected class |
BasicFileChooserUI.GoHomeAction
在“家”键事件或等效事件上行事。
|
protected class |
BasicFileChooserUI.NewFolderAction
创建一个新文件夹。
|
protected class |
BasicFileChooserUI.SelectionListener |
protected class |
BasicFileChooserUI.UpdateAction
重新扫描当前目录中的文件
|
Constructor and Description |
---|
BasicFileChooserUI(JFileChooser b) |
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
protected Icon directoryIcon
protected Icon fileIcon
protected Icon computerIcon
protected Icon hardDriveIcon
protected Icon floppyDriveIcon
protected Icon newFolderIcon
protected Icon upFolderIcon
protected Icon homeFolderIcon
protected Icon listViewIcon
protected Icon detailsViewIcon
protected Icon viewMenuIcon
protected int saveButtonMnemonic
protected int openButtonMnemonic
protected int cancelButtonMnemonic
protected int updateButtonMnemonic
protected int helpButtonMnemonic
protected int directoryOpenButtonMnemonic
protected String saveButtonText
protected String openButtonText
protected String cancelButtonText
protected String updateButtonText
protected String helpButtonText
protected String directoryOpenButtonText
protected String saveButtonToolTipText
protected String openButtonToolTipText
protected String cancelButtonToolTipText
protected String updateButtonToolTipText
protected String helpButtonToolTipText
protected String directoryOpenButtonToolTipText
public BasicFileChooserUI(JFileChooser b)
public static ComponentUI createUI(JComponent c)
BasicFileChooserUI
组件创建一个BasicFileChooserUI实现。
默认情况下, BasicLookAndFeel
类使用所有基本UI类的createUI
方法实例化UI。
c
- 需要一个UI的
JFileChooser
BasicFileChooserUI
对象
UIDefaults.getUI(JComponent)
public void installUI(JComponent c)
ComponentUI
ComponentUI
实例作为指定组件上的UI委托时,将调用此方法。
该方法应该完全配置组件的外观,包括以下内容:
LayoutManager
上安装LayoutManager。 PropertyChangeListener
上创建/安装PropertyChangeListener,以便适当地检测和响应组件属性更改。 installUI
在
ComponentUI
c
- 安装此UI代理的组件
ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
installUI
上完成的installUI
。
当这个UIComponent
实例作为指定组件的UI委托被删除时,将调用此方法。
该方法应该撤消在installUI中执行的installUI
,小心使JComponent
实例处于干净状态(无外部侦听器,外观特定属性对象等)。
这应该包括以下内容:
uninstallUI
在
ComponentUI
c
- 从中删除此UI代理的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
public void installComponents(JFileChooser fc)
public void uninstallComponents(JFileChooser fc)
protected void installListeners(JFileChooser fc)
protected void uninstallListeners(JFileChooser fc)
protected void installDefaults(JFileChooser fc)
protected void installIcons(JFileChooser fc)
protected void installStrings(JFileChooser fc)
protected void uninstallDefaults(JFileChooser fc)
protected void uninstallIcons(JFileChooser fc)
protected void uninstallStrings(JFileChooser fc)
protected void createModel()
public BasicDirectoryModel getModel()
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc)
public String getFileName()
public String getDirectoryName()
public void setFileName(String filename)
public void setDirectoryName(String dirname)
public void rescanCurrentDirectory(JFileChooser fc)
rescanCurrentDirectory
在
FileChooserUI
public void ensureFileIsVisible(JFileChooser fc, File f)
ensureFileIsVisible
在
FileChooserUI
public JFileChooser getFileChooser()
public JPanel getAccessoryPanel()
protected JButton getApproveButton(JFileChooser fc)
public JButton getDefaultButton(JFileChooser fc)
FileChooserUI
LookAndFeel
默认按钮。
JFileChooser
将使用此按钮作为对话窗口的默认按钮。
public String getApproveButtonToolTipText(JFileChooser fc)
public void clearIconCache()
protected MouseListener createDoubleClickListener(JFileChooser fc, JList list)
public ListSelectionListener createListSelectionListener(JFileChooser fc)
protected boolean isDirectorySelected()
true
iff当前是否选择一个目录。
protected void setDirectorySelected(boolean b)
b
- 如果当前选择了一个目录。
protected File getDirectory()
directory
属性
setDirectory(java.io.File)
protected void setDirectory(File f)
f
- 表示当前选择的目录的
File
对象
public FileFilter getAcceptAllFileFilter(JFileChooser fc)
getAcceptAllFileFilter
在
FileChooserUI
public FileView getFileView(JFileChooser fc)
getFileView
在
FileChooserUI
public String getDialogTitle(JFileChooser fc)
getDialogTitle
在
FileChooserUI
public int getApproveButtonMnemonic(JFileChooser fc)
public String getApproveButtonText(JFileChooser fc)
getApproveButtonText
在
FileChooserUI
public Action getNewFolderAction()
public Action getGoHomeAction()
public Action getChangeToParentDirectoryAction()
public Action getApproveSelectionAction()
public Action getCancelSelectionAction()
public Action getUpdateAction()