Class BasicFileChooserUI
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
Nested ClassesModifier and TypeClassDescriptionprotected classAccept all file filter.protected classResponds to an Open or Save requestprotected classA basic file view.protected classResponds to a cancel request.protected classChange to parent directory action.protected classA double click listener.protected classActs on the "home" key event or equivalent event.protected classCreates a new folder.protected classA selection listener.protected classRescans the files in the current directory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intCancel button mnemonicprotected StringCancel button textprotected StringCancel button tool tip textprotected IconComputer iconprotected IconDetails view iconprotected IconDirectory iconprotected intThe mnemonic keycode used for the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringThe label text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected StringThe tooltip text displayed on the approve button when a directory is selected and the current selection mode is FILES_ONLY.protected IconFile iconprotected IconFloppy drive iconprotected IconHard drive iconprotected intHelp button mnemonicprotected StringHelp button textprotected StringHelp button tool tip textprotected IconHome folder iconprotected IconList view iconprotected IconNew folder iconprotected intOpen button mnemonicprotected StringOpen button textprotected StringOpen button tool tip textprotected intSave button mnemonicprotected StringSave button textprotected StringSave button tool tip textprotected intUpdate button mnemonicprotected StringUpdate button textprotected StringUpdate button tool tip textprotected IconUp folder iconprotected IconView menu icon -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the icon cache.protected MouseListenercreateDoubleClickListener(JFileChooser fc, JList<?> list) Creates a double click listener.Creates a list selection listener.protected voidCreates the model.Creates the property change listener.static ComponentUICreates aBasicFileChooserUIimplementation for the specified component.voidensureFileIsVisible(JFileChooser fc, File f) Ensure the file in question is visible.Returns the default accept all file filterReturns the accessory panel.protected JButtonReturns the approve button.intReturns 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 FileProperty to remember the directory that is currently selected in the UI.Returns the directory name.Returns the file chooser.Returns the file name.Returns a file view.Returns a go home action.getModel()Returns the model.Returns a new folder action.Returns an update action.voidInstalls the components.protected voidInstalls the defaults.protected voidInstalls the icons.protected voidInstalls the listeners.protected voidInstalls the strings.voidInstalls the UI.protected booleanProperty to remember whether a directory is currently selected in the UI.voidRescan the current directory.protected voidsetDirectory(File f) Property to remember the directory that is currently selected in the UI.voidsetDirectoryName(String dirname) Sets the directory name.protected voidsetDirectorySelected(boolean b) Property to remember whether a directory is currently selected in the UI.voidsetFileName(String filename) Sets the file name.voidUninstalls the components.protected voidUninstalls the defaults.protected voidUninstalls the icons.protected voidUninstalls the listeners.protected voidUninstalls the strings.voidUninstalls the UI.Methods declared in class FileChooserUI
getDefaultButtonMethods declared in class 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 aBasicFileChooserUIimplementation for the specified component. By default theBasicLookAndFeelclass usescreateUImethods of all basic UIs classes to instantiate UIs.- Parameters:
c- theJFileChooserwhich needs a UI- Returns:
- the
BasicFileChooserUIobject - Since:
- 1.7
- See Also:
-
installUI
Installs the UI.- Overrides:
installUIin classComponentUI- Parameters:
c- the component- See Also:
-
uninstallUI
Uninstalls the UI.- Overrides:
uninstallUIin classComponentUI- Parameters:
c- the component- See Also:
-
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
-
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
-
createPropertyChangeListener
Creates the property change listener.- Parameters:
fc- the file chooser- Returns:
- the property change listener
-
getFileName
-
getDirectoryName
-
setFileName
-
setDirectoryName
Sets the directory name.- Parameters:
dirname- the file name
-
rescanCurrentDirectory
Rescan the current directory.- Specified by:
rescanCurrentDirectoryin classFileChooserUI- Parameters:
fc- the file chooser
-
ensureFileIsVisible
Ensure the file in question is visible.- Specified by:
ensureFileIsVisiblein classFileChooserUI- Parameters:
fc- the file chooserf- the file
-
getFileChooser
-
getAccessoryPanel
-
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:
trueiff 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
directoryproperty - Since:
- 1.4
- See Also:
-
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- theFileobject representing the directory that is currently selected- Since:
- 1.4
-
getAcceptAllFileFilter
Returns the default accept all file filter- Specified by:
getAcceptAllFileFilterin classFileChooserUI- Parameters:
fc- the file chooser- Returns:
- an accept-all file filter
-
getFileView
Description copied from class:FileChooserUIReturns a file view.- Specified by:
getFileViewin classFileChooserUI- Parameters:
fc- the file chooser- Returns:
- a file view
-
getDialogTitle
Returns the title of this dialog- Specified by:
getDialogTitlein 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:
getApproveButtonTextin classFileChooserUI- Parameters:
fc- the file chooser- Returns:
- approve button text.
-
getNewFolderAction
-
getGoHomeAction
-
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
-