java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.FileChooserUI
javax.swing.plaf.basic.BasicFileChooserUI
- Direct Known Subclasses:
MetalFileChooserUI
Basic L&F implementation of a FileChooser.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Accept all file filter.protected class
Responds to an Open or Save requestprotected class
A basic file view.protected class
Responds to a cancel request.protected class
Change to parent directory action.protected class
A double click listener.protected class
Acts on the "home" key event or equivalent event.protected class
Creates a new folder.protected class
A selection listener.protected class
Rescans the files in the current directory -
Field Summary
Modifier and TypeFieldDescriptionprotected int
Cancel button mnemonicprotected String
Cancel button textprotected String
Cancel button tool tip textprotected Icon
Computer iconprotected Icon
Details view iconprotected Icon
Directory iconprotected int
The mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected String
The label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected String
The tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected Icon
File iconprotected Icon
Floppy drive iconprotected Icon
Hard drive iconprotected int
Help button mnemonicprotected String
Help button textprotected String
Help button tool tip textprotected Icon
Home folder iconprotected Icon
List view iconprotected Icon
New folder iconprotected int
Open button mnemonicprotected String
Open button textprotected String
Open button tool tip textprotected int
Save button mnemonicprotected String
Save button textprotected String
Save button tool tip textprotected int
Update button mnemonicprotected String
Update button textprotected String
Update button tool tip textprotected Icon
Up folder iconprotected Icon
View menu icon -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the icon cache.protected MouseListener
createDoubleClickListener(JFileChooser fc, JList<?> list)
Creates a double click listener.Creates a list selection listener.protected void
Creates the model.Creates the property change listener.static ComponentUI
createUI(JComponent c)
Creates aBasicFileChooserUI
implementation for the specified component.void
ensureFileIsVisible(JFileChooser fc, File f)
Ensure the file in question is visible.Returns the default accept all file filterReturns the accessory panel.protected JButton
Returns the approve button.int
Returns the approve button mnemonic.Returns approve button text.Returns the approve button tool tip.Returns an approve selection action.Returns a cancel selection action.Returns a change to parent directory action.Returns the title of this dialogprotected File
Property to remember the directory that is currently selected in the UI.Returns the directory name.Returns the file chooser.Returns the file name.getFileView(JFileChooser fc)
Returns a file view.Returns a go home action.getModel()
Returns the model.Returns a new folder action.Returns an update action.void
Installs the components.protected void
Installs the defaults.protected void
installIcons(JFileChooser fc)
Installs the icons.protected void
Installs the listeners.protected void
Installs the strings.void
installUI(JComponent c)
Installs the UI.protected boolean
Property to remember whether a directory is currently selected in the UI.void
Rescan the current directory.protected void
setDirectory(File f)
Property to remember the directory that is currently selected in the UI.void
setDirectoryName(String dirname)
Sets the directory name.protected void
setDirectorySelected(boolean b)
Property to remember whether a directory is currently selected in the UI.void
setFileName(String filename)
Sets the file name.void
Uninstalls the components.protected void
Uninstalls the defaults.protected void
Uninstalls the icons.protected void
Uninstalls the listeners.protected void
Uninstalls the strings.void
Uninstalls the UI.Methods declared in class javax.swing.plaf.FileChooserUI
getDefaultButton
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
-
Field Details
-
directoryIcon
Directory icon -
fileIcon
File icon -
computerIcon
Computer icon -
hardDriveIcon
Hard drive icon -
floppyDriveIcon
Floppy drive icon -
newFolderIcon
New folder icon -
upFolderIcon
Up folder icon -
homeFolderIcon
Home folder icon -
listViewIcon
List view icon -
detailsViewIcon
Details view icon -
viewMenuIcon
View menu icon -
saveButtonMnemonic
protected int saveButtonMnemonicSave button mnemonic -
openButtonMnemonic
protected int openButtonMnemonicOpen button mnemonic -
cancelButtonMnemonic
protected int cancelButtonMnemonicCancel button mnemonic -
updateButtonMnemonic
protected int updateButtonMnemonicUpdate button mnemonic -
helpButtonMnemonic
protected int helpButtonMnemonicHelp button mnemonic -
directoryOpenButtonMnemonic
protected int directoryOpenButtonMnemonicThe mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.- Since:
- 1.4
-
saveButtonText
Save button text -
openButtonText
Open button text -
cancelButtonText
Cancel button text -
updateButtonText
Update button text -
helpButtonText
Help button text -
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
Save button tool tip text -
openButtonToolTipText
Open button tool tip text -
cancelButtonToolTipText
Cancel button tool tip text -
updateButtonToolTipText
Update button tool tip text -
helpButtonToolTipText
Help button tool tip text -
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
-
BasicFileChooserUI
Constructs aBasicFileChooserUI
.- Parameters:
b
- file chooser
-
-
Method Details
-
createUI
Creates aBasicFileChooserUI
implementation for the specified component. By default theBasicLookAndFeel
class usescreateUI
methods of all basic UIs classes to instantiate UIs.- Parameters:
c
- theJFileChooser
which needs a UI- Returns:
- the
BasicFileChooserUI
object - Since:
- 1.7
- See Also:
UIDefaults.getUI(JComponent)
-
installUI
Installs the UI.- Overrides:
installUI
in classComponentUI
- Parameters:
c
- the component- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
-
uninstallUI
Uninstalls the UI.- Overrides:
uninstallUI
in classComponentUI
- Parameters:
c
- the component- See Also:
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
-
installComponents
Installs the components.- Parameters:
fc
- the file chooser
-
uninstallComponents
Uninstalls the components.- Parameters:
fc
- the file chooser
-
installListeners
Installs the listeners.- Parameters:
fc
- the file chooser
-
uninstallListeners
Uninstalls the listeners.- Parameters:
fc
- the file chooser
-
installDefaults
Installs the defaults.- Parameters:
fc
- the file chooser
-
installIcons
Installs the icons.- Parameters:
fc
- the file chooser
-
installStrings
Installs the strings.- Parameters:
fc
- the file chooser
-
uninstallDefaults
Uninstalls the defaults.- Parameters:
fc
- the file chooser
-
uninstallIcons
Uninstalls the icons.- Parameters:
fc
- the file chooser
-
uninstallStrings
Uninstalls the strings.- Parameters:
fc
- the file chooser
-
createModel
protected void createModel()Creates the model. -
getModel
Returns the model.- Returns:
- the model
-
createPropertyChangeListener
Creates the property change listener.- Parameters:
fc
- the file chooser- Returns:
- the property change listener
-
getFileName
Returns the file name.- Returns:
- the file name
-
getDirectoryName
Returns the directory name.- Returns:
- the directory name
-
setFileName
Sets the file name.- Parameters:
filename
- the file name
-
setDirectoryName
Sets the directory name.- Parameters:
dirname
- the file name
-
rescanCurrentDirectory
Rescan the current directory.- Specified by:
rescanCurrentDirectory
in classFileChooserUI
- Parameters:
fc
- the file chooser
-
ensureFileIsVisible
Ensure the file in question is visible.- Specified by:
ensureFileIsVisible
in classFileChooserUI
- Parameters:
fc
- the file chooserf
- the file
-
getFileChooser
Returns the file chooser.- Returns:
- the file chooser
-
getAccessoryPanel
Returns the accessory panel.- Returns:
- the accessory panel
-
getApproveButton
Returns the approve button.- Parameters:
fc
- the file chooser- Returns:
- the approve button
-
getApproveButtonToolTipText
Returns the approve button tool tip.- Parameters:
fc
- the file chooser- Returns:
- the approve button tool tip
-
clearIconCache
public void clearIconCache()Clears the icon cache. -
createDoubleClickListener
Creates a double click listener.- Parameters:
fc
- the file chooserlist
- the list- Returns:
- a double click listener
-
createListSelectionListener
Creates a list selection listener.- Parameters:
fc
- the file chooser- Returns:
- a list selection listener
-
isDirectorySelected
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
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
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(java.io.File)
-
setDirectory
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
- theFile
object representing the directory that is currently selected- Since:
- 1.4
-
getAcceptAllFileFilter
Returns the default accept all file filter- Specified by:
getAcceptAllFileFilter
in classFileChooserUI
- Parameters:
fc
- the file chooser- Returns:
- an accept-all file filter
-
getFileView
Description copied from class:FileChooserUI
Returns a file view.- Specified by:
getFileView
in classFileChooserUI
- Parameters:
fc
- the file chooser- Returns:
- a file view
-
getDialogTitle
Returns the title of this dialog- Specified by:
getDialogTitle
in classFileChooserUI
- Parameters:
fc
- the file chooser- Returns:
- the title of this dialog
-
getApproveButtonMnemonic
Returns the approve button mnemonic.- Parameters:
fc
- the file chooser- Returns:
- the approve button mnemonic
-
getApproveButtonText
Returns approve button text.- Specified by:
getApproveButtonText
in classFileChooserUI
- Parameters:
fc
- the file chooser- Returns:
- approve button text.
-
getNewFolderAction
Returns a new folder action.- Returns:
- a new folder action
-
getGoHomeAction
Returns a go home action.- Returns:
- a go home action
-
getChangeToParentDirectoryAction
Returns a change to parent directory action.- Returns:
- a change to parent directory action
-
getApproveSelectionAction
Returns an approve selection action.- Returns:
- an approve selection action
-
getCancelSelectionAction
Returns a cancel selection action.- Returns:
- a cancel selection action
-
getUpdateAction
Returns an update action.- Returns:
- an update action
-